Jump to content
bos

How to force customers to chose shipping method?

Recommended Posts

Posted (edited)

I have reported a Free Shipping-bug (see #2098) and I am now looking for a quick-hack to a workaround, since I'm in need of a free shipping option (or "Local pick-up").

It is possible to add a zero cost line in All In One Shipping-extension, but there is a problem with this; the extension auto-default-selects the cheapest shipping option, which means customers will get "Local pick-up" auto-selected, and realize this until after they've paid. This complicates things a lot, so I had to remove it.

But still, I need the option.

Therefore; is there a quick-hack to make the extension NOT auto-select any option at all, forcing the customer to pick the suitable option (and thus reducing the risk of chosing "Local pick-up" by mistake)? I poked around in the source-code for the extension, but I realized it was way over my head.

 

Edited by bos

Share this post


Link to post
Share on other sites

you don't need to change the module for this, adjust it at your store theme. Default to "please select" for your shipping options, should be a simple case of adding that option before the foreach loop

Share this post


Link to post
Share on other sites

I'm unable to use ionCube-extensions, so I cannot try that.

Share this post


Link to post
Share on other sites

Anyone should be able to download ioncube loaders to your local hosting area even if your hosting company is backward enough to not have them installed server wide by default. A hosting account is supposed to facilitate you doing what you need (obviously without compromising security / speed etc) not restrict you - suggest maybe changing hosting companies !

Share this post


Link to post
Share on other sites
49 minutes ago, Noodleman said:

you don't need to change the module for this, adjust it at your store theme. Default to "please select" for your shipping options, should be a simple case of adding that option before the foreach loop

All In One Shipping adds a `selected="selected"´ to its first option, so I added a `selected="selected"´ as well, for the "Please select" option as you describe.

Now the produced HTML-code looks like this:

Quote

Välj fraktsätt <select name="shipping" class="update_form required"><option value="" selected="selected">-- välj --</option><optgroup label="All In One Shipping"><option value="eyJvZmZzZXQiOjEsIm5hbWUiOiJBbGxfSW5fT25lX1NoaXBwaW5nIiwicHJvZHVjdCI6IlZhbmxpZ3QgYnJldiA1MGciLCJ2YWx1ZSI6MTUsInRheF9pZCI6OTk5OTk5LCJ0YXgiOnsiYW1vdW50IjoiMC4wMCIsInRheF9pbmNsdXNpdmUiOjEsInRheF9uYW1lIjoiaW5oZXJpdGVkIn19" selected="selected">¹ 15.00kr (Vanligt brev 50g)</option></optgroup></select>

That is, two `selected="selected"´, and the one from All In One Shipping seems to have higher priority so it still gets auto-selected.

I cannot find a way to tell All In One Shipping not to auto-select. There's no option for this anywhere.

 

I will take a look at bsmither's suggested topics and see if these can help me.

Share this post


Link to post
Share on other sites

ah, yea two "selected" and it will always add the last one as the actual selected value. you can try removing "{$method.selected}" but not sure if this would cause an issue after somebody has actually chosen their method, I'm assuming it would.

in which case, you can add some if/else logic, if the method = All In One, then do nothing, else use method.selected. 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×