Forum

Thread tagged as: Problem, Shop

Cart Displaying Incorrect Shipping Zone's Price

Hi. I have had an issue going on for awhile now (Previous Forum Post: https://forum.grabaperch.com/forum/02-13-2018-perch-shop-default-shipping-zone).

Basically, my issue is that the cart is displaying a shipping price for the incorrect shipping zone.

In debug, it somehow is marking USA as the shipping zone rather than the shipping zone of the currently logged in customer. This is inconsistent as well - sometimes if I try on a separate computer it updates the shipping price to the correct when I hit the 'Update Cart' button. The only difference in the debug on the cart page is the 'cartID' and the c.countryID.

For example: Right now I have one machine open with a customer logged in with a Sweden shipping address that is displaying the correct shipping amount. CartID=23. The line in debug with c.countryID (217 is Sweden): SELECT z.* FROM perch3_shop_shipping_zones z LEFT JOIN perch3_shop_shipping_zone_countries c ON z.zoneID=c.zoneID WHERE z.zoneActive=1 AND z.zoneDeleted IS NULL AND (c.countryID=217 OR zoneIsDefault=1) ORDER BY zoneIsDefault ASC LIMIT 1

On a separate machine I have that same customer logged in but the shipping amount is the amount for a USA shipping address (and it will not change when I try to update cart). CartID=24. (237 is USA) SELECT z.* FROM perch3_shop_shipping_zones z LEFT JOIN perch3_shop_shipping_zone_countries c ON z.zoneID=c.zoneID WHERE z.zoneActive=1 AND z.zoneDeleted IS NULL AND (c.countryID=237 OR zoneIsDefault=1) ORDER BY zoneIsDefault ASC LIMIT 1

Any help is appreciated.

Diagnostics:

Perch: 3.1.1, PHP: 5.6.30, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: WINNT, cgi-fcgi
Installed apps: content (3.1.1), assets (3.1.1), categories (3.1.1), perch_shop_orders (1.2.6), perch_shop_products (1.2.6), perch_shop (1.2.6), perch_members (1.6.4)
App runtimes: <?php $apps_list = [ 'perch_members', 'perch_shop' ]; ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: C:\inetpub\wwwroot\Motorcam-dev\perch
PERCH_CORE: C:\inetpub\wwwroot\Motorcam-dev\perch\core
PERCH_RESFILEPATH: C:\inetpub\wwwroot\Motorcam-dev\perch\resources
Image manipulation: GD
PHP limits: Max upload 100M, Max POST 100M, Memory: 1024M, Total max file upload: 100M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: C:\inetpub\wwwroot\Motorcam-dev
HTTP_HOST: motorcamdev.sungraphicsmedia.com
Jared Dutra

Jared Dutra 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are these existing customers or new customers each time?

Existing customers. I have yet to be able to produce this issue with a customer that has items in their cart THEN creates a new customer account.

Anything else I can look into?

As an update, I recreated a very basic shop to see if it was the way I set it up. The issue was still there, so I recreated another one locally and can see the issue is gone. So I can confirm it is a configuration issue on my end.

I also notice I cannot actually set an address. I use:

<?php
  if (!perch_shop_addresses_set()) {
    perch_shop_order_address_form();
  }
?>

and every time I confirm the address (Using the default template) it sets it once but does not stay set when it redirects to cart.

I know it's not on your end, but are there any thoughts on what this could be?