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.
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!"
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
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:
$info = $this->globals('ecom.customship'); if ($info['country'] == 'Not Listed') {$this->globals('ecom.customship_response',array('Shipping Location Error' => 0)); return 1;}
Offline
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
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.
Offline
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
This is exactly the solution we decided upon.
Offline
Bumping this so I don't lose it.
Offline