keat Posted February 17, 2016 Share Posted February 17, 2016 I have 2 shipping plugins installed. The all in One and Collect in Store When i place a dummy order, it seems to default to 'Collect in Store' which will undoubtedly cause issues when we go live. Customers will click through and miss this. Is there any way to default to 'All in One' Link to comment Share on other sites More sharing options...
bsmither Posted February 17, 2016 Share Posted February 17, 2016 There isn't a way to force CubeCart to choose one shipper over another. CubeCart gathers all available shipping methods into a list, and while doing so, will find the cheapest method and show that as the pre-selected choice. There are conversations on the forum that will have CubeCart pre-select the most expensive choice, or display the shipping choices with a "Please Select" or as a stack of radio buttons with none initially selected. Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 17, 2016 Share Posted February 17, 2016 10 minutes ago, bsmither said: as a stack of radio buttons with none initially selected. I used to use a tweak Bsmither worked out for me sometime in the past that showed all choices at once (v5 I think). It did help cut down on web illiterate customer errors. "Please Select" seems to be working for us for now. Link to comment Share on other sites More sharing options...
keat Posted February 17, 2016 Author Share Posted February 17, 2016 I see 'Please Select' is in the file 'content.checkout.php' but for whatever reason, the cart doesn't seem to want to default to it. Do you have any links to the 'Please Select' fix. I found lots of discussions but now my head hurts. Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 17, 2016 Share Posted February 17, 2016 Hmmm - well, Please Select is still there, but it doesn't show until the drop down box is clicked - didn't used to be that way - sounds like a bug to me. I tried it logged in as a customer and logged out as admin, and also logged out admin and ghost customer - neither shows Please Select initially. So it's not you, it's the code. Link to comment Share on other sites More sharing options...
bsmither Posted February 17, 2016 Share Posted February 17, 2016 The code where CubeCart identifies the cheapest shipping choice needs to be bypassed. That way, the choice is not automatically selected and "Please Select" will show. Link to comment Share on other sites More sharing options...
keat Posted February 17, 2016 Author Share Posted February 17, 2016 If you mean the one below, then I tried this but i'm not sure it worked. We offer free shipping for orders over £50 at which point I now have 2 free shipping options (free shipping) & (Collect in Store), and I'm pretty sure the shipping was then broken again. Whilst there are no cost implications, it does make a massive difference to how the items will be dispatched. if (!isset($cheapest['value']) || $value['value'] < $cheapest['value']) { $cheapest = $value; } Link to comment Share on other sites More sharing options...
bsmither Posted February 18, 2016 Share Posted February 18, 2016 Not sure it worked? Be sure to completely empty the shopping basket between trials -- once CubeCart has an idea of which shipping choices to show as selected, that is not easily forgotten. By make a comment of:// $cheapest = $value; $cheapest will never be set. Link to comment Share on other sites More sharing options...
keat Posted February 18, 2016 Author Share Posted February 18, 2016 // Lets try to choose cheapest shipping option // for them if they haven't chosen already if (!isset($this->_basket['shipping']) && !$digital_only) { foreach ($shipping_values as $value) { if (!isset($cheapest['value']) || $value['value'] < $cheapest['value']) { $cheapest = $value; If I change < to > and follow through to completion, it does appear to display the most expensive option, and provided I close the browser and go back in to create a fresh order over £50, it does appear to show 'Free Shipping' rather than 'Collect in Store' It would be nice to default to 'Please Select' though Anything else that i tinker with, I get an error stating "no suitable shipping methods" Link to comment Share on other sites More sharing options...
bsmither Posted February 18, 2016 Share Posted February 18, 2016 I have reported in the past that the "basket" and "confirm" checkout pages have a problem. That past report claimed I could not change the quantity. Now I see that it is difficult, if not impossible to change the shipping choice. This is because there are two sets of shipping selectors: the first shown for medium-up and a second shown for small-only. Submitting the form will have the second selector's value POSTed, which still has an empty value (corresponds to "Please Select"), overwriting the first selector's value, which has a valid choice. Link to comment Share on other sites More sharing options...
bsmither Posted February 18, 2016 Share Posted February 18, 2016 Well, due to some bad code I had added to the javascript file, the script was crashing before it could micromanage the second set of form fields. That got fixed and now back to square 3. Try these edits: /classes/cubecart.class.php Near line 691, change to the following: // Check shipping has been defined for tangible orders if (!isset($this->_basket['digital_only'])) { if (!isset($this->_basket['shipping'])) { // $GLOBALS['gui']->setError($GLOBALS['language']->checkout['error_shipping']); $gatway_proceed = false; } } Near line 1603, change to the following: foreach ($shipping_values as $value) { if (!isset($cheapest['value']) || $value['value'] < $cheapest['value']) { // $cheapest = $value; } } Link to comment Share on other sites More sharing options...
keat Posted February 19, 2016 Author Share Posted February 19, 2016 I put a number of dummy orders through and completed through to checkout. It appears to default to please select. Mr Smither, you are indeed a god. Link to comment Share on other sites More sharing options...
bsmither Posted February 19, 2016 Share Posted February 19, 2016 What is needed next is to make sure that the form validator catches the fact that the current value of the shipping selector is empty. And that is needed because we just suppressed the displaying of an actual warning that the shipping needs to be selected. In another conversation dealing with this, it was desired that the error message be changed to a Notice (green) and re-worded to be more helpful. Link to comment Share on other sites More sharing options...
keat Posted February 19, 2016 Author Share Posted February 19, 2016 Starting next week, I'll be putting quite a number of dummy orders through, so this will be the utimate test. Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 19, 2016 Share Posted February 19, 2016 I've tested it on our plushcatalog, and it's working as expected for me. Looking forward to your further testing, @keat! Link to comment Share on other sites More sharing options...
keat Posted February 22, 2016 Author Share Posted February 22, 2016 I placed 3 dummy orders today ( i uncovered another issue, but that's something different). All 3 orders defaulted to 'Please Select', so I'm happy that this is working. Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 24, 2016 Share Posted March 24, 2016 Quote What is needed next is to make sure that the form validator catches the fact that the current value of the shipping selector is empty. And that i sneeded because we just suppressed the displaying of an actual warning that the shipping needs to be selected. In another conversation dealing with this, it was desired that the error message be changed to a Notice (green) and re-worded to be more helpful. Any suggestions to keep a customer from trying to checkout without choosing a shipping method, if these edits prevent them from being warned? Well, I just tried to create an order without choosing any shipping. Since we do not allow ghost customers, it worked just fine. After the new customer registered, they DID get a message to be sure the shipping choice was appropriate - it was NOT a red warning, but a blueish box. But for stores where people can order without registering, would they be able to pay without ever choosing any shipping method? Link to comment Share on other sites More sharing options...
sailing123 Posted December 12, 2017 Share Posted December 12, 2017 Hi guys, I would like to re-open this case please. I am on 6.1.10 and I have applied Bmither above codes (twice now, just in case) and it works all fine except it does not force the customer to select a shipping method. So I then tried to continue with checkout, was allowed to enter my details (as an unregistered customer) but on the point of continuing with gateway, the page reloaded with no error message. The customer does not get transferred to the gateway platform which is good but there is no message coming up to say you must select shipping first. I then added "selected disabled" to the option: <option value="" selected disabled>{$LANG.form.please_select}</option> in content.checkout.medium-up.php, made no difference. Al tells me I need to request a feature for this but was wondering if anyone would have a solution sooner than waiting for the next update. Many thanks S Link to comment Share on other sites More sharing options...
Dirty Butter Posted April 27, 2018 Share Posted April 27, 2018 On 2/19/2016 at 4:16 AM, bsmither said: What is needed next is to make sure that the form validator catches the fact that the current value of the shipping selector is empty. And that is needed because we just suppressed the displaying of an actual warning that the shipping needs to be selected. In another conversation dealing with this, it was desired that the error message be changed to a Notice (green) and re-worded to be more helpful. Trying to add the Please Select default to Shipping on 6.2.0. I could not find the conversation you referenced dealing with the green notice, rather than allowing payment without shipping charge. Link to comment Share on other sites More sharing options...
Dirty Butter Posted November 4, 2019 Share Posted November 4, 2019 Not sure what to comment out in 6.2.7 cubecart.class.php to continue to see Please Select on storefront. I still prefer that to showing the default selection, although the new code is certainly an improvement in my view. Link to comment Share on other sites More sharing options...
bsmither Posted November 6, 2019 Share Posted November 6, 2019 With this: https://forums.cubecart.com/topic/47002-resolved-default-shipping-method/ The idea of breaking out of the loop looking for the cheapest (or, now, the most expensive, etc) by putting a break; on the same line as the foreach() statement, should still work. Be sure to deal with the error banner that shows, if you haven't already. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.