Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    590
    Plugin Contributions
    0

    Default Possible bug in USPS shipping

    We have many shipments to Canada, and have just run into an issue that I didn't think could happen. A Canadian customer managed to specify USPS domestic shipping on an international order. Our people didn't catch it, but our shipping software did, so it had the correct label with the customs info, at least. But we were charged for the international shipping (twice as much as the customer paid for domestic shipping of the same box).

    I suspected this customer might also have a US address, and that turned out to be the case. It appears that she entered the order to begin with using her US address, and then after choosing a USPS Small Flat Rate box, she changed the address back to her Canadian one. I have no reason to think she did this deliberately in order to pay less shipping. I think she was probably just trying to make sure she had the correct Canadian address in there for the billing. I duplicated the problem using her account. While the shopping cart screenshot does show the 'Billing Address,' not the 'Shipping Address,' the packing slip and invoice show the Canadian address for both shipping and billing, and the domestic shipping choice. I've edited the image to remove white space and conceal personal details, but otherwise it's just as it shows on my screen.

    I have rules in place now to catch anything like this. But people are fallible and if it could happen once, it could happen again and cost us a lot more money than it did this time. Hope the reason for this can be found and the problem fixed.

    Name:  kerfers.jpg
Views: 122
Size:  31.0 KB

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Possible bug in USPS shipping

    I somewhat think that this is more than an issue with USPS based on the testing that I also have now performed. It's not easy to reproduce, but I was able to do so moving forwards and backwards through the process.

    It looks like what could happen and similar to this situation, is that when a price is first presented, the lowest price is provided/selected. When the destination address is changed, (and in this case results in a higher priced shipping method to be available) there is nothing that resets the shipping method and as a result, there is already a shipping method identified and therefore the lowest price is not again sought/reset. After a little navigation around with the browser, it could be possible to still have the previously existing (though no longer correct) shipping method active/selected and therefore the incorrect price applied.

    I would suggest the following code change in includes/modules/pages/checkout_shipping/header_php.php:

    Find:
    Code:
      // check that the currently selected shipping method is still valid (in case a zone restriction has disabled it, etc)
      if (isset($_SESSION['shipping'])) {
        $checklist = array();
        foreach ($quotes as $key=>$val) {
          if ($val['methods'] != '') {
            foreach($val['methods'] as $key2=>$method) {
              $checklist[] = $val['id'] . '_' . $method['id'];
            }
          } else {
            // skip
          }
        }
        $checkval = $_SESSION['shipping']['id'];
        if (!in_array($checkval, $checklist)) {
          $messageStack->add('checkout_shipping', ERROR_PLEASE_RESELECT_SHIPPING_METHOD, 'error');
        }
      }
    and add the below one line:
    Code:
      // check that the currently selected shipping method is still valid (in case a zone restriction has disabled it, etc)
      if (isset($_SESSION['shipping'])) {
        $checklist = array();
        foreach ($quotes as $key=>$val) {
          if ($val['methods'] != '') {
            foreach($val['methods'] as $key2=>$method) {
              $checklist[] = $val['id'] . '_' . $method['id'];
            }
          } else {
            // skip
          }
        }
        $checkval = $_SESSION['shipping']['id'];
        if (!in_array($checkval, $checklist)) {
          $messageStack->add('checkout_shipping', ERROR_PLEASE_RESELECT_SHIPPING_METHOD, 'error');
          unset($_SESSION['shipping']);
        }
      }
    Now this will mean that if one were to change addresses to eventually return to the original address that the selection would again be the lowest price and not perhaps a slightly higher priced, perhaps more desirable selection. But at least this way the chosen shipping selection would align with the destination.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Google Checkout v1.4.7 - Possible Bug with Shipping
    By stonecoldinc in forum Addon Shipping Modules
    Replies: 1
    Last Post: 16 Oct 2011, 10:25 PM
  2. usps actual shipping cost possible?
    By baltimorestreetmods in forum Addon Shipping Modules
    Replies: 5
    Last Post: 19 Apr 2007, 06:52 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