On the guest checkout:
edit: ...\catalog\controller\checkout\guest_step_1.php
Line 480'ish add
Edit: ...\catalog\language\english\checkout\guest_step_1.php
Add:
You'll need to repeat this anywhere the address is entered.
Not entirely tested but should be ok.
edit: ...\catalog\controller\checkout\guest_step_1.php
Line 480'ish add
Code: Select all
$filestring = $this->request->post['address_1'];
$findme = 'po box';
if (strlen(stristr($filestring,$findme))>0) {
$this->error['address_1'] = $this->language->get('error_address_1_pobox');
}
Add:
Code: Select all
$_['error_address_1_pobox'] = 'We can\'t ship to PO Boxes!';
Not entirely tested but should be ok.
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
That's fairly functional. One caveat, this also restricts those that have a PO Box for their payment address but not their shipping.
Also is there a way to add other spellings to the '$findme' string? Such as 'p.o. box' or 'p o box', etc.?
Thanks for the start!
Also is there a way to add other spellings to the '$findme' string? Such as 'p.o. box' or 'p o box', etc.?
Thanks for the start!
Try:
The only way I can think of sorting the other problem is by forcing seperate billing and shipping addresses.
Code: Select all
$filestring = $this->request->post['address_1'];
$keywords = array("po box","pobox","p.o. box");
foreach ( $keywords as $keyword ) {
if ( stripos( $filestring, $keyword ) !== FALSE ) {
$this->error['address_1'] = $this->language->get('error_address_1_pobox');
}
}
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
There are so many variations possible in what a customer might put into the address field that it is not practical to test for all of them. You may test for "po box", but should you also test for "post office box", "p o box", "box", etc.? If you do, what do you do for a customer who lives in a house on Box Road?
About the only thing you can do is to to post prominently in your Terms and Conditions that you cannot ship to post office boxes, and that orders will be significantly delayed and will be subject to a surcharge for correcting the error if a customer inputs such a shipping address. Make acceptance of the terms a requirement of the checkout page.
It's not much of a help, but here is a link to Amazon's policy page to help you get an idea of how the "big boys" handle the problem.
About the only thing you can do is to to post prominently in your Terms and Conditions that you cannot ship to post office boxes, and that orders will be significantly delayed and will be subject to a surcharge for correcting the error if a customer inputs such a shipping address. Make acceptance of the terms a requirement of the checkout page.
It's not much of a help, but here is a link to Amazon's policy page to help you get an idea of how the "big boys" handle the problem.
Please use proper English at all times, so that all members may understand you.
Indeed, that's true. If you make something more idiot-proof you will only attract a stronger breed of idiot.phaques wrote:... Just trying to make it as prominent as possible since people don't tend to read anything!
Please use proper English at all times, so that all members may understand you.
Who is online
Users browsing this forum: No registered users and 319 guests