FM Posted November 20, 2002 Posted November 20, 2002 I've been searching for the way to remove the automatic selection of the cheapest shipping method but cannot find it anywhere. My problem is that people all the time accidentally let the store pickup selected even when they want normal post delivery. If there would be a way to force customers to select a shipping method by themselves they would read the descriptions and select the correct one. So could someone with more knowledge help me a bit in this one :) Thank you!
wasson65 Posted December 5, 2002 Posted December 5, 2002 I've been searching for the way to remove the automatic selection of the cheapest shipping method but cannot find it anywhere.My problem is that people all the time accidentally let the store pickup selected even when they want normal post delivery. If there would be a way to force customers to select a shipping method by themselves they would read the descriptions and select the correct one. So could someone with more knowledge help me a bit in this one :) Thank you! in shipping.php, around line 80, look for this line: if (!tep_session_is_registered('shipping')) $shipping = $shipping_modules->cheapest(); and comment it out. This should force the selection of a shipping type. Tim
FM Posted December 5, 2002 Author Posted December 5, 2002 Hello! I could not found that line in my version on osc. In catalog/includes/classes/shipping.php i removed these: function cheapest() { if (MODULE_SHIPPING_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $GLOBALS[$class]->cheapest(); } } } } But it gave an error message: Call to undefined function: cheapest() The file I have is this verion: shipping.php,v 1.13 2002/05/27
wasson65 Posted December 5, 2002 Posted December 5, 2002 Ack! I've been looking at too many different files today. I meant to say in checkout_shipping.php, around line 80. The line that I show commenting out just looks to see if the shipping has been set, and if it hasn't, it sets it to the cheapest. However, the code I'm working from is post-Nov-1 (the new checkout procedure). I'm not sure how different your's is. At any rate, what you need to do is find where it's defaulting the shipping. What you did was to removed the function named cheapest that was being called by the defaulting code. try doing a search for "cheapest" in the php files, and somewhere there's a call to cheapest to default the shipping if it's not set. Hope this gets you closer to the right direction... Tim
FM Posted December 5, 2002 Author Posted December 5, 2002 Ok thanks for the directions :) I removed this line from checkout_payment.php $shipping_modules->cheapest(); That removed the automatic selection of the store pickup module but now there is a new problem: The cart lets people confirm their order without selecting any shipping methods. Is there a way I could choose one of the shipping modules as a default or force people to select one like in payment modules? Thank you very much for help! [/code]
wasson65 Posted December 6, 2002 Posted December 6, 2002 Ok thanks for the directions :) I removed this line from checkout_payment.php $shipping_modules->cheapest(); That removed the automatic selection of the store pickup module but now there is a new problem: The cart lets people confirm their order without selecting any shipping methods. Is there a way I could choose one of the shipping modules as a default or force people to select one like in payment modules? Thank you very much for help! [/code] Maybe you could just modify the cheapest function to do what you need. Instead of selecting the cheapest, it could select the one with the right name. Instead of a "cheapest" function, it works like a "default shipping" function. Tim
FM Posted December 14, 2002 Author Posted December 14, 2002 The problem is that I don't know how to edit it :( I would just need the cart to force one shipping method to be chosen.
MikeMike Posted January 7, 2003 Posted January 7, 2003 I would also be interested in this. How do I modify this code from checkout_shipping.php to choose UPS ground as default instead of the cheapest way? // if no shipping method has been selected, automatically select the cheapest method if (!tep_session_is_registered('shipping')) $shipping = $shipping_modules->cheapest(); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING); $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); ?>
aperfecthost Posted January 8, 2003 Posted January 8, 2003 Here is a forum thread I found in a search. It might be your answer. http://www.oscommerce.com/forums/viewtopic.php...shipping+method HOpe that helps.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.