Set default selected shipping method
I have a store where we offer different shipping methods, we also offer the ability to collect in store, this is the cheapest method and the shop selects this as default to be the shipping option as it is the cheapest, is there a way not to have this method selected as the default option as customers are not looking what this shipping method means.
Re: Set default selected shipping method
Re: Set default selected shipping method
Re: Set default selected shipping method
Quote:
Originally Posted by
stevesh
This is not Paypal Express friendly. Anyone got a fix before invest another hour of my life I'll never get back?
Thanks
Twitch.
Re: Set default selected shipping method
If you don't want PayPal Express Checkout to auto-select cheapest shipping, just turn that switch off in your ZC Express Checkout settings.
Re: Set default selected shipping method
Quote:
Originally Posted by
DrByte
If you don't want PayPal Express Checkout to auto-select cheapest shipping, just turn that switch off in your ZC Express Checkout settings.
It is off. That's the unfortunate part. I posted a fix for the buggy stock 'storepickup' shipping module here:
http://www.zen-cart.com/forum/showthread.php?t=178003
The result of that fix is now the store pickup works, the shipping estimator doesn't see the $0.00 value and selects the correct 'cheapest' shipping option :).
However, even with the paypal 'cheapest' switch off in admin, clicking the express checkout or landing on the shipping options page returns the default selection to the $0.00 in store pickup option.
I have looked at the fix for the 'cheapest' code on the shipping options page ->remming out the line that operates the selection causes paypal to see the $0.00 in store shipping module or none at all.
(fix found in the forum looks at includes/templates/your_template/tpl_checkout_shipping_default.php and asks to hide this line:
$checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $_SESSION['shipping']['id']) ? true : false);
This to me defeats the purpose of having cart filters if you're just going to shut them off)
So, instead of a hack, I'm looking at a solid hard coded fix now. If you've got any advice I'd be happy to hear it.
Thanks
Twitch.
Re: Set default selected shipping method
It seems to me you're using the system in a way it wasn't intended. Why are you using the "Store Basis" method in the first place? And why are you charging tax on a Store Pickup option? Shouldn't it be free?
In short I don't think I agree with your alleged "fix", and it seems clear to me that I can't offer any assistance without knowing EXACTLY what I need to do to my brand new clean fresh uncustomized install of v1.3.9h in order to be able to replicate your problem. And the "why" behind all the settings you've set. After that, then maybe I might be able to offer some assistance.
Re: Set default selected shipping method
I'm confused because when I look at the cheapest_method function, it explicitly checks for storepickup and will not use that as the cheapest rate. However, I think this is a bug because if storepickup is the ONLY rate, it still will not get selected as the cheapest. This causes issues with mods like FEC.
Here is my fix.
Change line 172 to:
PHP Code:
if (($rates[$i]['cost'] < $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') || $size == 1) {
and line 176 to:
PHP Code:
if ($rates[$i]['module'] != 'storepickup' || $size == 1) {
Re: Set default selected shipping method
DrByte,
Would it be possible to somehow achieve this using an observer?
At the bottom of the function I see:
PHP Code:
$this->notify('NOTIFY_SHIPPING_MODULE_CALCULATE_CHEAPEST', $cheapest);
return $cheapest;
Re: Set default selected shipping method
How to select the default cheapest shipping module - turn off the storepickup filter.
Updated for ZenCart 1.51, Clean Install, Twitch Wholesale with Wholesale Attributes Installed.
As mentioned previously - just hide the original code, you may need it again.
includes/classes/shipping.php
Hide line 176
// if ($rates[$i]['cost'] < $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') {
Change it to this...
if ($rates[$i]['cost'] < $cheapest['cost']) {
Then hide the second filter:
line 180 - 182 like this...
// if ($rates[$i]['module'] != 'storepickup') {
$cheapest = $rates[$i];
// }
Why you ask? The cart at http://sheldrakeautomotive.com/sacart/ is being used to track wholesale inventory for a wholesale customer, they don't pay shipping charges and want a quick and simple checkout.
What about Retail?
I excluded the Twitch Wholesale/Retail filter, if you have Twitch Wholesale installed and would like it just message me.