Jump to content

Shipping method select box


geoffb

Recommended Posts

Hi,

 

I have 2 shipping methods, 1 Flat rate method, and 1 for orders over £100.00.

 

At the moment the shipping method select box is being a little annoying as a buyer. 

 

What I would really like is for the select box to be gone and to have something that says 'All orders under £100.00 standard delivery charge' then as currently it is the £3.99 charge is shown.

 

At the moment you have to choose this method even though its the only one and even after its chosen it isnt remembered so you have to do it again after getting a warning message and click Update too, such a pain.

 

Asside from this I would like to also display 'FREE DELIVERY' with the charge of £0.00 being shown for orders over £100, at the moment I'm getting the included images as the view of this selection box and it looks messy and unprofessional.

 

Please help.

Link to comment
Share on other sites

Wanting to change Free Shipping to FREE DELIVERY, please access the Free Shipping shipping module. In the Name field, enter your desired expression, FREE SHIPPING.

 

FYI: If you do not want the bold shipping group names, you can switch that off at Store Settings, Features tab, Disable Shipping Groups is enabled.

 

"Not remembering the shipping method...."

 

My impression was that the latest version of Cubecart got that fixed. Let us know the exact version you are using. Could this be more to do with CubeCart not having the customer's delivery address between the first page where the shipping selection is made and the second where it is "forgotten"? According to the images, this is the point in the checkout process where CubeCart does not have a customer address (the superscripted 1 is prepended to the shipping cost).

 

"I would really like for the select box to be gone and to have something that says 'All orders under £100.00 standard delivery charge of £3.99."

 

That's very easy to do, actually -- keep in mind that this then becomes fixed and prevents showing any additional shipping methods.

 

The code edits to do that will be posted shortly.

Link to comment
Share on other sites

Hi Brian,

 

I had version 5.2.7 running so have just updated to 5.2.8

 

Can't help but panic when I update these things in-case something breaks that worked previously!

 

With regard to this that you said: keep in mind that this then becomes fixed and prevents showing any additional shipping methods

 

Will this stop me having the FREE DELIVERY on orders over £100.00?

 

Geoff

Link to comment
Share on other sites

"Will this stop me having the FREE DELIVERY on orders over £100.00?"

 

This will stop you from being able to choose any shipping choice at all. The indicated phrase will show, but the shipping will be appropriate.

 

In the skin template file content.checkout.php, find:

{if isset($SHIPPING)}
<p>
  <span class="price">{$CUSTOMER_LOCALE.mark} {$SHIPPING_VALUE}</span>
  <span class="price">{$LANG.basket.shipping}</span>
  $LANG.basket.shipping_select
  <select name="shipping" class="select update_form required shippingSelect">
    <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}>{$CUSTOMER_LOCALE.mark} {$method.display}</option>
    {/foreach} {if $HIDE_OPTION_GROUPS ne '1'}</optgroup>{/if} {/foreach}
  </select>
</p>
{/if}

Replace with:

{if isset($SHIPPING)}
<p>
  <span class="price">{$CUSTOMER_LOCALE.mark} {$SHIPPING_VALUE}</span>
  <span class="price">{$LANG.basket.shipping}</span>
  {* $LANG.basket.shipping_select *}
  {* <select name="shipping" class="select update_form required shippingSelect">
    <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}>{$CUSTOMER_LOCALE.mark} {$method.display}</option>
    {/foreach} {if $HIDE_OPTION_GROUPS ne '1'}</optgroup>{/if} {/foreach}
  </select>  *}
  {$CUSTOMER_LOCALE.mark} {$SHIPPING['Free Shipping'][0]['display']}
</p>
{/if}

This inhibits Smarty from showing the selector. Instead, we show a specific element from the SHIPPING array: Free Shipping, first (and only) option, the displayed shipping phrase.

 

In the Free Shipping module, for the name, enter:

All orders under £100.00 standard delivery charge of £3.99.

Enable and Save.

 

Make sure the Flat Rate module is enabled, as well.

 

The last thing we need to do is undo the presumptuous formatting of the displayed name. Until this change is made, you will get:

£0.00 (All orders under £100.00 standard delivery charge of £3.99)

Note the parentheses and the leading value. This is what you would normally see in the drop-down selector.

 

(How this phrase reads should be left to the skin logic, and not be pre-assembled in the core code.)

 

I will return with what to change in the core code.

Link to comment
Share on other sites

Ok, more testing means a change to the above:

Was:
{$CUSTOMER_LOCALE.mark} {$SHIPPING['Free Shipping'][0]['display']}
Now:
{$CUSTOMER_LOCALE.mark} All orders under £100.00 standard delivery charge of {$SHIPPING['Flat Rate'][0]['price']}

 

In the file cubecart.class.php, near line1435-1438, change:

Was:
$option = array(
  'value' => base64url_encode(json_encode($value)),
  'display' => (isset($data['name'])) ? $GLOBALS['tax']->priceFormat($data['value'], true).$data['name'] : $data['desc']
);
Now:
$option = array(
  'value' => base64url_encode(json_encode($value)),
  'display' => (isset($data['name'])) ? trim($data['name'], " ()") : $data['desc'], // $GLOBALS['tax']->priceFormat($data['value'], true).$data['name'] : $data['desc']
  'price' => $GLOBALS['tax']->priceFormat($data['value'], true),
);

The problem earlier was that when the subtotal is less than 100.00, the Free Shipping phrase is no longer available to Smarty in the template. So we have to use a hard-coded phrase.

Link to comment
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...