2

I'm building a store for a client that will be selling regular products alongside alcoholic products. They want to limit the shipping countries available if the cart has alcoholic products added. Is this possible in expresso store out of the box? Looking for the best way to go about it.

0

Not out of the box, no. But I've done this before by using the store_order_recalculate_start hook. I looped through all of the items in the $order, and if any product met my criteria, I set a cookie saying so (in your case, it could be as simple as saying limit_countries or something, but you could get more complex by storing data in a hashed array).

Then you need a plugin tag to check for that cookie, and if present you show a different list of countries during checkout.

This is a simplified example, but it's roughly the path you'd need to take.

| improve this answer | |
  • Thanks Derek. At least I know which rabbit hole to head down now ;) – Micky Kelleher Jan 23 '15 at 11:30

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.