I have a product that is part of a Groupon-like promotion. The customer purchases a promo code at the Groupon-like website and those coupon codes are entered into my Ubercart system as 100%-off discounts. I want to only allow this particular product to be purchased when one of those specific codes has been entered into the cart. In other words, the credit card entry panel would not appear until they have entered a valid code for that product's promotion.

Is that possible? If so, how might I accomplish that? Rules/Conditional Actions?



1 Answer 1


There is no easy way to do this sadly, your best bet would be to try and play around with hook_form_validate or hook_form_submit on the ubercart form submit and see if you can find the field values in one of the submitted panes.

If that doesn't work then your best bet would be to try and code your own "pre review order" coupon box, that hooks into the cart view page. So what I am thinking is

  • Users goes to /cart
  • Has the listing of the items in the cart
  • Has the "coupon stuff" at the buttom, but part of the "Checkout" form (use form_alter for example)
  • And use the hook_form_validate hook to verify it has data, and the coupon is good, then proceed
  • OK, that's a good idea. I will take a look at it from that angle. Thanks!
    – hockey2112
    Commented Sep 24, 2013 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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