Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2007
    Location
    Ayutthaya, Thailand
    Posts
    21
    Plugin Contributions
    0

    bug Default Shipping Method Problem

    Zen Cart 1.3.7
    Database Patch Level: 1.3.7
    Server OS: Linux 2.6.19.2-UP
    Database: MySQL 4.1.20-max-log
    HTTP Server: Apache
    PHP Version: 4.3.11 (Zend: 1.3.0)

    I have two shipping modules setup:
    1. free shipping options with total >= £100.00
    2. table rate

    The problem I found is:

    When I have £100.00 or more in the shopping cart and go to check out, both shipping methods show up and the free shipping method is selected as default, which is correct. Then I go back to the shopping cart and remove some items to make the total amount less than 100. After that, I go to check out again, and only table rate shows up. However, it is not automatically selected as default. If I click continue without selecting it, it takes me back to the page again without any error message.

    Also, if I have less than £100.00 in the shopping cart and go to check out, only table rate shows up, and it is selected as default. This is correct. Then I go back to the shopping cart and add more items to make the total amount more than £100. After that, I go to check out again, and both shipping method show up, but the table rate is still selected as default. It should default to free shipping instead.

    Thanks,
    Toey

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Default Shipping Method Problem

    At the present time, once a shipping method is selected, it remembers that selection until the customer changes it or completes checkout or logs out.

    If the selection is not valid for checkout, the customer is not allowed to complete checkout without selecting a valid option.
    .

    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.

  3. #3
    Join Date
    Mar 2007
    Location
    Ayutthaya, Thailand
    Posts
    21
    Plugin Contributions
    0

    Default Re: Default Shipping Method Problem

    Will there be any fixes?
    Or, this is how it suppose to work...
    [FONT=Courier New]Toey Thongprajiad[/FONT]
    [FONT=Courier New]www.TTTzone.com[/FONT]
    [FONT=Courier New][/FONT]

  4. #4
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Default Shipping Method Problem

    There may be a "fix" to ensure that an error message is properly displayed if the previously-selected choice is no longer valid ... I'm surprised you're not seeing any error/warning about that.

    What template are you using?
    What customizations have you made to the templates used for checkout pages?
    .

    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
    Mar 2007
    Location
    Ayutthaya, Thailand
    Posts
    21
    Plugin Contributions
    0

    Default Re: Default Shipping Method Problem

    I have my own template. But I use default tempaltes for all checkout process. There is no customization on the checkout process.

    I also tested on a demo site, http://demo.opensourcecms.com/zencart/ , and I got the same result.

    I looked at the header.php of checkout_shipping page, but I couldn't find any code that sends out error. Not sure if I look at the right place...

    While waiting for the fix, I am planing to make a hack to it. I am thinking that if the selected shipping module is no longer exist, I will default to the cheapest one. (This is what my client wants.):

    on line 172 of /includes/modules/pages/checkout_shipping/header.php.

    Code:
     
    // if no shipping method has been selected, automatically select the cheapest method.
    // if the modules status was changed when none were available, to save on implementing
    // a javascript force-selection method, also automatically select the cheapest shipping
    // method if more than one module is now enabled
      if ( !$_SESSION['shipping'] || ( $_SESSION['shipping'] && ($_SESSION['shipping'] == false) && (zen_count_shipping_modules() > 1) ) ) {
       $_SESSION['shipping'] = $shipping_modules->cheapest();
      } else {
     $x3 = false;
     foreach ($quotes as $x1) {
      if ($x1["id"] == $_SESSION['shipping']['module']) {
       $x3 = true;
      }
     }
     if (!$x3) {
      $_SESSION['shipping'] = $shipping_modules->cheapest();
     }
    }
    Does it look ok? Is it the right place to do the hack?

    Thanks
    [FONT=Courier New]Toey Thongprajiad[/FONT]
    [FONT=Courier New]www.TTTzone.com[/FONT]
    [FONT=Courier New][/FONT]

  6. #6
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Default Shipping Method Problem

    I too am looking for a fix/solution to this issue.

    Toeyt, did your fix work?

  7. #7
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Default Shipping Method Problem

    I also noticed that if changing the address (on the checkout step 1 page), to one with a different shipping zone, the cheapest new shipping method is automatically selected. I'm going to look at this code now and see if it can be copied for use elsewhere.

  8. #8
    Join Date
    Mar 2007
    Location
    Ayutthaya, Thailand
    Posts
    21
    Plugin Contributions
    0

    Default Re: Default Shipping Method Problem

    Quote Originally Posted by Alex Clarke View Post
    I too am looking for a fix/solution to this issue.

    Toeyt, did your fix work?

    I tested it in test environment, and it worked fine.
    But I didn't implement it on the live site.
    The owner of the site didn't want to hack the site. He can live with the issue...

    Good luck
    Toey
    [FONT=Courier New]Toey Thongprajiad[/FONT]
    [FONT=Courier New]www.TTTzone.com[/FONT]
    [FONT=Courier New][/FONT]

  9. #9
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Default Shipping Method Problem

    I've got this working on my live site and it's running fine.

    Thanks for this bit of code, it's very useful. :)

  10. #10
    Join Date
    Mar 2007
    Location
    Ayutthaya, Thailand
    Posts
    21
    Plugin Contributions
    0

    Default Re: Default Shipping Method Problem

    Quote Originally Posted by Alex Clarke View Post
    I've got this working on my live site and it's running fine.

    Thanks for this bit of code, it's very useful. :)

    You are very welcome... Glad it can be useful.
    [FONT=Courier New]Toey Thongprajiad[/FONT]
    [FONT=Courier New]www.TTTzone.com[/FONT]
    [FONT=Courier New][/FONT]

 

 

Similar Threads

  1. Shipping method default selection
    By kanine in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 3 Sep 2010, 03:06 AM
  2. Setting Shipping Method to Default to ON
    By jasonhoward64 in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 11 Apr 2010, 10:08 PM
  3. Set shipping method to Default?
    By Chariotz in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 5 Dec 2009, 03:25 AM
  4. default shipping method
    By 100asa in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 7 Aug 2007, 04:37 PM

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