Guest Posted March 5, 2007 Share Posted March 5, 2007 Hello. I have just tried to make the change I found in the Shipping add-ons section of contributions to add the percent calculation function for the table rate shipping module. This is it: Open the /shop/includes/modules/shipping/table.php file and find out the following code in the file: $table_cost = split("[:,]" , MODULE_SHIPPING_TABLE_COST); $size = sizeof($table_cost); for ($i=0, $n=$size; $i<$n; $i+=2) { if ($order_total <= $table_cost[$i]) { $shipping = $table_cost[$i+1]; break; } } Then modify the code to the follwoing code: $table_cost = split("[:,]" , MODULE_SHIPPING_TABLE_COST); $size = sizeof($table_cost); for ($i=0, $n=$size; $i<$n; $i+=2) { if ($order_total <= $table_cost[$i]) { $pos = strpos($table_cost[$i+1], '%'); if ($pos === false) { $shipping = $table_cost[$i+1]; } else { $shipping_cost_temp = split("%", $table_cost[$i+1]); $shipping = $order_total * $shipping_cost_temp[0] / 100; } break; } } I first made a backup copy of the table.php file to be safe. Once I made the above code change to table.php, the shipping module in the Admin section became damaged. This is how it looks now: Shipping Modules Modules Sort Order Action Flat Rate Per Item Table Rate 1 In other words I lost all of the other shipping options, and these three that are left will not even let me configure them. My immediate response was to restore the backup, but it did no good. The only thing I can think of is that I may have had the Table Rate shipping module installed when I replace the code in table.php, and that may have caused the problem. Is there any way to fix this? If anyone can help I would really appreciate it, as I am in real trouble now. Thank you, Michael Cook Link to comment Share on other sites More sharing options...
Guest Posted March 5, 2007 Share Posted March 5, 2007 OK. The problem is solved, and much simpler than I thought. Here's the deal: I realized that the shipping modules stopped at Table Rate in the store Admin. On a long shot, I decided to remove the backup file from :http://mystore.com/catalog/includes/modules/shipping, which I had left in there: table_bu.php. This fixed the problem. Apparently the Admin files read the contents of the shipping module directory, and it was getting "stuck". Thanks in advance to anyone who was about to help me, and I hope this may help someone who might run into the same problem. Michael Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.