Forum

Thread tagged as: Question, Problem, Shop

Perch Shop Default Shipping Zone

I have a Perch Shop set up with a few countries entered in. I have a default zone as a catch all called 'Rest of the World':

alt text for image

A customer from Norway placed an order, but was charged the United States amount. (I'm not sure how well the quality of the image below will show, but it shows that 'Rest of the World' and 'United States' both are checked available.)

alt text for image

I did confirm the shipping address is set to Norway. I even made a fake account with the same address and it was charging the correct amount for me. So I can't reproduce this issue but I'm posting this in hopes someone will know what happened.

alt text for image

Diagnostics:

Perch: 3.0.12, PHP: 5.6.30, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: WINNT, cgi-fcgi
Installed apps: content (3.0.12), assets (3.0.12), categories (3.0.12), perch_shop_orders (1.2.5), perch_shop_products (1.2.5), perch_shop (1.2.5), perch_members (1.6.2)
App runtimes: <?php $apps_list = [ 'perch_members', 'perch_shop' ];
PERCH_LOGINPATH: /perch
PERCH_PATH: C:\inetpub\wwwroot\Motorcam-live\perch
PERCH_CORE: C:\inetpub\wwwroot\Motorcam-live\perch\core
PERCH_RESFILEPATH: C:\inetpub\wwwroot\Motorcam-live\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-live
HTTP_HOST: specialtymotorcams.com
Jared Dutra

Jared Dutra 0 points

  • 6 months ago
Drew McLellan

Drew McLellan 2578 points
Perch Support

Has the customer updated their address since ordering? The address history is stored, so you should be able to see.

No, his address has stayed the same since his account was created. I looked through the perch3_shop_address table, if there's somewhere better to look for previous addresses just let me know.

But in looking for this, I see there are two order IDs associated with his name in the same minute (valued as 135 & 136). OrderID 135's status is 'created' and has the correct shipping subtotal. OrderID 136 is the one that eventually went through with the incorrect subtotal. But both are for sure set to country 165, which without looking I'm assuming is Norway.

Drew McLellan

Drew McLellan 2578 points
Perch Support

I wonder if his session timed out at some point during the checkout.

I suppose there's no way of knowing for sure. Thanks for looking into it, if there's anything else that you think of that could've caused this just let me know.

Hi again, wasn't sure if I should post here or open a new thread. This same issue happened again today, but the shipping address was set to Germany instead of Norway. The shipping zone gets defaulted to United States (which is the default zone) but Germany is checked as an available zone.

There has been a handful of orders from the United States that don't raise any red flags, and one order from Canada that charged the correct amount since the last time this happened.

I would really appreciate any kind of help. Without a solution I'm forced to implement a new storefront, as it's costing me and my client a notable amount of money now.

Drew McLellan

Drew McLellan 2578 points
Perch Support

Are you running the current version of the software?

Diagnostics are the same as mentioned above.

This site is still on: Shop - 1.2.5 Members - 1.6.2 Perch - 3.0.12

I'll update now of course, but are any of the updates related to this issue?

Drew McLellan

Drew McLellan 2578 points
Perch Support

It's hard to say, as I don't know if the cause is something in Shop, or just how you've set things up.

Hi again. So I'm now able to reproduce this issue myself, but have no idea what is actually causing it. I rebuilt the entire shop and followed the directions closely with docs so I wouldn't screw anything up. Then I created many test accounts with several shipping addresses. When I'm logging into an account that should be flagged as "Rest of the World" it is giving me the United States shipping cost. This is on the dev environment and I can provide anything you might need to give me a lead on why this is happening.

If you'd rather me start a new thread I can, otherwise here is what I have:

Updated 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

Debug on the "Review Order" page that's displaying the incorrect shipping amount:

SELECT * FROM perch3_members_sessions WHERE sessionID='d0f549a9b4745ff3c9e4227c77d1e34d98d11456' AND sessionHttpFootprint='72e4cf6d1f11cec3058090963ad7886efb464c86' AND sessionExpires>'2018-04-30 18:41:07' LIMIT 1
User is logged in
[1] SELECT * FROM perch3_pages WHERE pagePath='/review.php' LIMIT 1
[1] SELECT * FROM perch3_shop_cart WHERE cartID=6
[1] SELECT * FROM perch3_shop_cart WHERE cartID=6
[2] SELECT regionKey, regionHTML FROM perch3_content_regions WHERE regionPage='/review.php' OR regionPage='*' ORDER BY regionPage DESC
Using cart from cache.
[29] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
[1] Using template: \templates\shop\cart\ReviewOrder.html

Hopefully this gives some clues to what the issue could be. I can provide anything else that you might find helpful.

This may or may not help. But I am noticing that when I log out of one account, and log into a different customer account with different shipping address the cartID stays the same. Not sure if that's supposed to happen or not but regardless the shipping still is incorrect.

Also, when I'm not logged into any account, it defaults to 'United States' shipping zone and I'm unsure why. This is the debug that is outputted when I 'update' cart (sorry for the long mess):

--the debug is extremely long and it will not let me post it without an error, so here's a link-- https://motorcamdev.sungraphicsmedia.com/debugmessage.html

Hi, I was wondering if anyone has had a look at this. A line that sticks out to me in the cart's debug is:

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

I'm not logged into an account with a shipping address as the United States, nor is the US the default zone.

Drew McLellan

Drew McLellan 2578 points
Perch Support

Is 237 USA in your database?

Hi Drew, yes - 237 is USA