I have three pages that each describe a product that we sell. Each of those pages has a button/link that says "buy now". Those links all take you to a single Ubercart product page with a select list attribute where they can select the name of any of the three products that I mentioned previously and add that product to their cart.

I'd like to have the name of the product from which they came automatically selected in that attribute field. Is there a way to do this via some kind of URL string, or another method?


1 Answer 1


Use hook_form_alter or hook_form_FORM_ID_alter, check your stuff (get parameter maybe), then apply the selected item though the form api

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.