Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 01-28-2021 19:25:47

dskowron
Member
Registered: 11-26-2008
Posts: 138

Disallowing orders from certain countries

This question isn't particular to any version so here goes. I have a custom shipping script which sets different shipping rates for a few different countries. Since every order is shipped, every order has to be sifted through this script to see what the shipping charges are going to be. Let me back up a step or two . . .

We do not ship to certain countries but simply removing their entries in System>Locations>Countries doesn't stop them from placing order. It happens all the time and the country is just stated as "Not Listed" and the order goes through like any other order. This behavior is unacceptable. So . . .

Since every order has to touch the shipping routine, THAT would be a perfect place to simply toss that person out of the program and tell them "NO SOUP FOR YOU!" smile

How would one go about aborting the order process at that point? I would like to see the order nulled out and the inventory returned to its state prior to the attempted order. Or, at minimum, the order is refused by the system. If necessary we can deal with the inventory issue manually.

Offline

 

#2 01-29-2021 09:18:20

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19717
Website

Re: Disallowing orders from certain countries

This is easy to do in K9.  You can trigger a checkout-blocking error in your custom shipping script simply by using a name for the shipping method that contains the word 'error' (using any case - as in 'Shipping Rate Error').  Returning this shipping method when the country is 'Not Listed'.  Ie:

Code:

$info = $this->globals('ecom.customship');

if ($info['country'] == 'Not Listed') {$this->globals('ecom.customship_response',array('Shipping Location Error' => 0)); return 1;}

Nick Hendler

Offline

 

#3 01-29-2021 09:44:37

dskowron
Member
Registered: 11-26-2008
Posts: 138

Re: Disallowing orders from certain countries

Would it work in 8x?

webmaster wrote:

This is easy to do in K9.  You can trigger a checkout-blocking error in your custom shipping script simply by using a name for the shipping method that contains the word 'error' (using any case - as in 'Shipping Rate Error').  Returning this shipping method when the country is 'Not Listed'.  Ie:

Code:

$info = $this->globals('ecom.customship');

if ($info['country'] == 'Not Listed') {$this->globals('ecom.customship_response',array('Shipping Location Error' => 0)); return 1;}

Offline

 

#4 02-01-2021 09:12:34

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19717
Website

Re: Disallowing orders from certain countries

The code in the custom script would work in V8, however V8 has no mechanism to block checkout based on shipping methods.  So while the script would work, there would be no checkout blocking.


Nick Hendler

Offline

 

#5 02-06-2021 07:50:36

robprotronica
Member
Registered: 12-16-2008
Posts: 106

Re: Disallowing orders from certain countries

You could leave the "Not Listed" country out of shipping forms so that there is no possibility of selecting a country except the ones you actively include - that's the way we handle it.

The "Not Listed" country lives at the vey end of the list by default - just set display in contact and shipping forms to false as required.

Offline

 

#6 02-06-2021 10:13:18

dskowron
Member
Registered: 11-26-2008
Posts: 138

Re: Disallowing orders from certain countries

This is exactly the solution we decided upon.

Offline

 

Board footer