Eliminate pre-selecting shipping method
Here is a way to prevent ZC from pre-selecting the cheapest shipping option on checkout Step 1 Shipping Method page. I have also included a way to prevent the Shipping Estimater from displaying the cheapest method in bold font.
--
Feature modified:Checkout Shipping Methods
Objective:Disable pre-selection of cheapest shipping method during checkout.
Comments:
- This affects Step 1 "Shipping Method" page of the checkout process. Upon entering this page all radio buttons will be in an unselected state until the customer makes a selection.
- All applicable shipping options will be displayed and none will be pre-selected.
- Customers cannot continue to the next step until a shipping option has been selected.
- Radio buttons for selected shipping method are cleared each time customer visits this page. If the customer moves from Step 1 Shipping Method to Step 2 Payment Information and then chooses to back into Step 1 again, the customer will have to reselect his/her shipping option.
Procedure:
- Locate file: /includes/templates/[custom]/templates/tpl_checkout_shipping_default.php. If the file does not exist, copy /includes/templates/template_default/tpl_checkout_shipping_default.php and place in /includes/templates/[custom]/templates/ folder.
- Modify /includes/templates/[custom]/templates/tpl_checkout_shipping_default.php.as follows: find around line 79 the following code:
Code:
// set the radio button to be checked if it is the method chosen
$checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $_SESSION['shipping']['id']) ? true :
false);
if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
change to:
Code:
// set the radio button to be checked if it is the method chosen
// BEGIN disable automatic selection of cheapest shipping rate
// $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $_SESSION['shipping']['id']) ? true
: false);
// END
if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
----------
Feature modified:Shipping Estimater
Objective:Disable bold facing the cheapest shipping option.
Comments:All applicable shipping options will be displayed and none will be displayed with bold font.
Procedure:
- Locate file: /includes/templates/[custom]/templates/tpl_modules_shipping_estimater.php. If the file does not exist, copy /includes/templates/template_default/tpl_modules_shipping_estimator.php and place in /includes/templates/[custom]/templates folder.
- Modify /includes/templates/[custom]/templates/tpl_modules_shipping_estimater.php as follows: find around line 134 the following code:
Code:
if($selected_shipping['id'] == $thisquoteid){
?>
<td class="bold"><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['methods'][$j]['title']; ?>)</td>
<td class="cartTotalDisplay bold"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'],
$quotes[$i]['tax'])); ?></td>
</tr>
and change to:
Code:
if($selected_shipping['id'] == $thisquoteid){
?>
<!-- modified to disable bolding of cheapest shipping option
<td class="bold"><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['methods'][$j]['title']; ?>)</td>
<td class="cartTotalDisplay bold"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'],
$quotes[$i]['tax'])); ?></td> -->
<td><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['methods'][$j]['title']; ?>)</td>
<td class="cartTotalDisplay"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'],
$quotes[$i]['tax'])); ?></td>
</tr>
Additional comments:This works with a shop that has UPS, USPS, and Free Shipping! (free shipper) enabled. I'm not sure if it works with other modules turned on. There is a lot of similar code earlier in the file and I'm not sure where that comes into play. A lot of it appears associated with one of the Free Shipping modules, so test thoroughly before going live.
Re: Eliminate pre-selecting shipping method
In post #1 I left out the following code change for the Shipping Estimater:
in /includes/templates/[custom]/templates/tpl_module_shipping_estimater.php
find line 107:
Code:
<td class="bold"><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['methods'][0]['title']; ?>)</td>
<td class="cartTotalDisplay bold"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])); ?></td>
change to:
Code:
<!-- BEGIN modified to disable bolding of cheapest shipping option -->
<!-- comment out 2 lines -->
<!-- <td class="bold"><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['methods'][0]['title']; ?>)</td> -->
<!-- <td class="cartTotalDisplay bold"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])); ?></td> -->
<!-- modified lines follow (2 lines) -->
<td><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['methods'][0]['title']; ?>)</td>
<td><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])); ?></td>
<!-- END modified -->
Re: Eliminate pre-selecting shipping method
Just a follow-up. Apparently Paypal Express accepts the default selected shipping method (the cheapest method).
I was trying to steer my customers who bought flammable liquids on my site to UPS Ground Service as US federal law prohibits shipping these products through the postal system or by any form of air transport. To do that I added some text to the service definitions and it seemed a lot of my customers simply ignored the messages. Now I realize they didn't even see the message because Paypal Express bypasses that screen.
I removed Paypal Express and all is good. I still have the Paypal IPN active.
Re: Eliminate pre-selecting shipping method
Quote:
Originally Posted by
ronlee67
Apparently Paypal Express accepts the default selected shipping method (the cheapest method).
... it only does that if you have it configured to do so. You can change that behavior in the Express Checkout module's settings in your admin.
Re: Eliminate pre-selecting shipping method
Quote:
Originally Posted by
DrByte
... it only does that if you have it configured to do so. You can change that behavior in the Express Checkout module's settings in your admin.
Thanks DrByte. You're a good person!
How you keep all this stuff in your head is beyond belief!
Thanks again for all the support you provide us.
Ron
Re: Eliminate pre-selecting shipping method
hello
i've made this modification 3 times to the default shipping stack and split checkout files i'm using. which is the fast and easy checkout files.
it appears to work ok with no radio button being preselected. but i have 2 problems which are both linked.
if the customer presses next without selecting an option it gives him/her the cheapest option and let's them move on.
also, at the top of the checkout page it shows order total etc and shows the cheapest postage option even if nothing is selected. this problem not as important as the other.
any ideas?
i didn't make the changes to the shipping estimator but didn't think this would affect the checkout.
Re: Eliminate pre-selecting shipping method
I changed the coded to what you stated in to eliminate the radio button auto selection. A get an error on line 45 when I change the code around line 79. Any ideas?
J.D.
Re: Eliminate pre-selecting shipping method
Re: Eliminate pre-selecting shipping method
thank you! i hope this makes people actually READ my shipping options before continuing their order!!
Re: Eliminate pre-selecting shipping method
I signed up just to say thanks! saved me a lot of time.