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%]

Type: Discussion
Status: New
JohntheFish
View Replies:
JohntheFish replied on at Permalink Reply
JohntheFish
The next version of eCommerce will now have features to support more descriptive messages when shipping is unavailable. ZBS will be enhanced to take advantage of this, so your checkout can display a nice clear message when shipping is unavailable.

http://www.concrete5.org/marketplace/addons/ecommerce/discussion/me...
joelhansen replied on at Permalink Reply
joelhansen
Hey John,

Glad I found this. :)

Best,

Joel
JohntheFish replied on at Permalink Reply
JohntheFish
[%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.
joelhansen replied on at Permalink Reply
joelhansen
Hey John,

[%null%] works well enough! :)

Rather than some JS, I just edited:
/packages/core_commerce/elements/checkout/shipping/method.php

<?php  } else { ?>
      <?php echo t('Shipping is Unavailable.');?>
   <?php  } ?>
   <div class="ccm-core-commerce-cart-buttons">
   <?php echo $this->controller->getCheckoutNextStepButton()?>


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

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.