Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2006
    Location
    Colorado Springs CO USA
    Posts
    516
    Plugin Contributions
    2

    Default 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:
    1. 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.
    2. 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:
    1. 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.
    2. 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']; ?>&nbsp;(<?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']; ?>&nbsp;(<?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']; ?>&nbsp;(<?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.
    www.aspenshopsonline.com - ZenCart 1.3.9h
    www.wilkssupply.com - ZenCart 1.3.9h
    www.un-du.net - ZenCart 1.3.8a

  2. #2
    Join Date
    Sep 2006
    Location
    Colorado Springs CO USA
    Posts
    516
    Plugin Contributions
    2

    Default 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']; ?>&nbsp;(<?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']; ?>&nbsp;(<?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']; ?>&nbsp;(<?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 -->
    www.aspenshopsonline.com - ZenCart 1.3.9h
    www.wilkssupply.com - ZenCart 1.3.9h
    www.un-du.net - ZenCart 1.3.8a

  3. #3
    Join Date
    Sep 2006
    Location
    Colorado Springs CO USA
    Posts
    516
    Plugin Contributions
    2

    Default 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.
    www.aspenshopsonline.com - ZenCart 1.3.9h
    www.wilkssupply.com - ZenCart 1.3.9h
    www.un-du.net - ZenCart 1.3.8a

  4. #4
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Eliminate pre-selecting shipping method

    Quote Originally Posted by ronlee67 View Post
    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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Sep 2006
    Location
    Colorado Springs CO USA
    Posts
    516
    Plugin Contributions
    2

    Default Re: Eliminate pre-selecting shipping method

    Quote Originally Posted by DrByte View Post
    ... 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
    www.aspenshopsonline.com - ZenCart 1.3.9h
    www.wilkssupply.com - ZenCart 1.3.9h
    www.un-du.net - ZenCart 1.3.8a

  6. #6

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

  7. #7
    Join Date
    Aug 2007
    Posts
    19
    Plugin Contributions
    0

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

  8. #8
    Join Date
    Apr 2008
    Posts
    38
    Plugin Contributions
    4

    Default Re: Eliminate pre-selecting shipping method

    thanks!!!

  9. #9
    Join Date
    Dec 2006
    Posts
    47
    Plugin Contributions
    0

    Default Re: Eliminate pre-selecting shipping method

    thank you! i hope this makes people actually READ my shipping options before continuing their order!!

  10. #10
    Join Date
    Feb 2011
    Posts
    10
    Plugin Contributions
    0

    Have a Drink Re: Eliminate pre-selecting shipping method

    I signed up just to say thanks! saved me a lot of time.

 

 

Similar Threads

  1. Blank Screen On Checkout After Selecting Shipping Method
    By andrewbt in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 30 Aug 2013, 12:36 AM
  2. Pre-Paid Label Method
    By games4gamers in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 5 Jan 2010, 05:49 PM
  3. Pre-select a shipping method?
    By Gem in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 3 Mar 2008, 06:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR