Jump to content

[Resolved} default shipping - Please Select


Recommended Posts

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 post
Share on other sites

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 post
Share on other sites
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 post
Share on other sites

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.:rolleyes:

 

Link to post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites

// 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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites
  • 1 month later...
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 post
Share on other sites
  • 1 year later...

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 post
Share on other sites
  • 4 months later...
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 post
Share on other sites
  • 1 year later...

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...