Refusing to ship to a location
Permalink Browser Info Environment
Suppose you only want to ship within a specified region, a city, a range of post codes, a state/county...
Outside that region, you want to refuse shipping.
Whatever you do, C5 eCommerce won't know that shipping is unavailable until a customer has entered their shipping address several steps into the checkout process. This is process related and nothing to do with shipping methods. Any eCommerce package (not just C5) will suffer from the same issue.
Bearing that in mind, once the customer is far enough into the process to enter the shipping address ZBS can be used to identify addresses within the area you want to ship to, and by omission, addresses outside the area.
For those inside, you can assign shipping cost rules.
For those outside, use the unknown cost message or the delivery message for any specifically unwanted zones and put [%null%] in the message.
ZBS will then return a null shipping type and eCommerce will consequently refuse to ship to that address.
For example, to only ship to a BS post code ...
Address Matching:
Country - equal to - United Kingdom - UKNational
Post Code - begins with - BS - UKLocal
Country - default - default - AnywhereElse
Cost Rules:
UKNational ....... [%null%]
UKLocal ...... Delivery to local area
AnywhereElse ...... [%null%]
Outside that region, you want to refuse shipping.
Whatever you do, C5 eCommerce won't know that shipping is unavailable until a customer has entered their shipping address several steps into the checkout process. This is process related and nothing to do with shipping methods. Any eCommerce package (not just C5) will suffer from the same issue.
Bearing that in mind, once the customer is far enough into the process to enter the shipping address ZBS can be used to identify addresses within the area you want to ship to, and by omission, addresses outside the area.
For those inside, you can assign shipping cost rules.
For those outside, use the unknown cost message or the delivery message for any specifically unwanted zones and put [%null%] in the message.
ZBS will then return a null shipping type and eCommerce will consequently refuse to ship to that address.
For example, to only ship to a BS post code ...
Address Matching:
Country - equal to - United Kingdom - UKNational
Post Code - begins with - BS - UKLocal
Country - default - default - AnywhereElse
Cost Rules:
UKNational ....... [%null%]
UKLocal ...... Delivery to local area
AnywhereElse ...... [%null%]
Type: | Discussion |
---|---|
Status: | Archived |
Hey John,
Glad I found this. :)
Best,
Joel
Glad I found this. :)
Best,
Joel
[%null%] works reliably to refuse shipping.
Unfortunately the [%error%] implementation in eCommerce only works when eCommerce has an alternative shipping choice available (for example 'Buyer collection only.').
So which of the 2 methods you use to refuse shipping will inevitably be a compromise.
If you look back in the ZBS forum pages, there are some posts about using JavaScript to remove the 'Next' button based on looking for a key in the delivery message.
Unfortunately the [%error%] implementation in eCommerce only works when eCommerce has an alternative shipping choice available (for example 'Buyer collection only.').
So which of the 2 methods you use to refuse shipping will inevitably be a compromise.
If you look back in the ZBS forum pages, there are some posts about using JavaScript to remove the 'Next' button based on looking for a key in the delivery message.
Hey John,
[%null%] works well enough! :)
Rather than some JS, I just edited:
/packages/core_commerce/elements/checkout/shipping/method.php
To just check if it hits an invalid shipping parameter.
Seems to work. :)
TY again!
Joel
[%null%] works well enough! :)
Rather than some JS, I just edited:
/packages/core_commerce/elements/checkout/shipping/method.php
To just check if it hits an invalid shipping parameter.
<?php } else { ?> <?php $no_shipping = true; echo t('Sorry, we do not curretly ship to that area. Please contact us directly for support.'); ?> <?php } ?> <div class="ccm-core-commerce-cart-buttons"> <?php if ($no_shipping != true) { echo $this->controller->getCheckoutNextStepButton(); } ?> <?php echo $this->controller->getCheckoutPreviousStepButton()?>
Seems to work. :)
TY again!
Joel
http://www.concrete5.org/marketplace/addons/ecommerce/discussion/me...