Jump to content

Adding correct shipping automatically


Recommended Posts

Hello, following a couple of changes made by Al a few months ago my shipping cost is not being added automatically as it was before, I use Weight Based Shipping which is working fine and always presents the correct amount but now the client has to select it from a drop down box, there is only one option in the drop down so it is not a question of the client adding the wrong amount but it used to be added automatically which is preferable. I have included a couple of screenshots below, once you select the shipping it is added to the amount column and then you can check out. Which PHP file would I need to look in to try and change this behaviour?

Many thanks.

Screen Shot 2021-01-02 at 11.58.52.png

Screen Shot 2021-01-02 at 11.59.38.png

Link to post
Share on other sites

Please remind us the exact version of CubeCart you are running.

We may also need to verify that the skin is not contributing to this.

I will need to double-check if CubeCart offers any sort of streamlining if there is only one shipping choice.

 

Link to post
Share on other sites

I have updated to the latest 6.4.2 but it has been like it for at least a year on the old version 6.2.9. I am using galaxyx skin.

It was working correctly until I had some work done by Al but then it developed this problem, I assume related to a change he made.

Which file would the be in?

Thanks.

Link to post
Share on other sites

In the file /classes/cart.class.php, there is the public function loadShippingModules(). The job of this function is to work through all enabled shipping modules and calculate the costs for each eligible shipping method.

That function is called by the file /classes/cubecart.class.php, in the public function _displayBasket(). This function receives the list of shipping methods and the costs calculated from each.

Somewhere around line 1725, coupons and taxes are applied to shipping, and recalculates everything if the choice of the shipping method changes.

Then, near line 1783, the cheapest, or cheapest greater than zero, or most expensive shipping method is found, and its name is passed to the skin.

(This function does a couple of other things that affect shipping, but are outside the scope of your observations.)

 

Link to post
Share on other sites

Hello, you mention that near line 1783, the cheapest, or cheapest greater than zero, or most expensive shipping method is found, and its name is passed to the skin. which of the skin files is it passed to?

Thanks,

Brian

 

Link to post
Share on other sites

Depending on the skin, the skin template content.checkout.medium-up.php and content.checkout.small.php. If those two sub-templates are not in the skin you are using, then look in content.checkout.php.

You want to find:

               {$LANG.basket.shipping_select}:
               <select name="shipping">
                  <option value="">{$LANG.form.please_select}</option>
                  {foreach from=$SHIPPING key=group item=methods}
                  {if $HIDE_OPTION_GROUPS ne '1'}
                  <optgroup label="{$group}">{/if}
                     {foreach from=$methods item=method}
                     <option value="{$method.value}" {$method.selected}>{$method.display}</option>
                     {/foreach}
                     {if $HIDE_OPTION_GROUPS ne '1'}
                  </optgroup>
                  {/if}
                  {/foreach}
               </select>

The variable {$method.selected} is determined near line 1769 in the CubeCart class.

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