0

Is there a module available to restrict the shipping of the particular product for particular shipping zone(country)? so that the message would appear and cancel the checkout.

1
  1. Add a field in variant for shipping restriction countries
  2. Add a rule in with event Collecting shipping rates for an order
  3. Add a php condition to get the line items details from $commerce_order
  4. Check shipping restricted countries with shipping address countries in your php function
  5. Remove the product by commerce_cart_order_product_line_item_delete()
  6. Add an action to show the msg on site
1

I'm fairly certain there isn't a module that does this. You can build this with rules, but the effect will be very rudimentary.

Create a rule reacting to order updates:

  1. Checks for a particular product included in the order.
  2. Checks to see if a shipping address condition is met.
  3. For your action, display a system message.
  4. Set the status of the order to cart or perhaps checkout:shipping.

That way you wouldn't be able to advance past the shipping status without having it fulfilled.

Not knowing your situation, cancelling an order is a bit extreme, but you could forward the user to a webform, change the status of the order to some new, internal value for review, or even just remove the product from the cart so that the customer can continue.

  • Yes, you are right. I am correcting it, I would prefer to remove that product from the cart so that the user can continue. – dhiraj900 Mar 1 '16 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.