I'd like to exclude any users from California or Texas from purchasing our products. How do I accomplish this?


I can give you steps to do it, you need to do coding against it:

  • First you need to show a popup through header file (Use in header to appear it on all pages not just home page)
  • Popup will get area of user
  • Popup then send a request to a controller through ajax
  • Controller will validate input of user and create a session/cookie against given value
  • Now before showing popup again, you need to check if session/cookie is assigned, if it is assigned then you wont show popup again
  • In add to cart file, you can add check of you session/cookie and hide add to cart and quantity from product page
  • You can also add this check in cart initialize and checkout initialize event (Check available events list for this) or you can simple add this check on controller and redirect user to home with a splash message that you can't order from California or Texas

Hope this will help you out

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.