Basically I have a few landing pages with forms with fields that are a subset of the checkout page form fields. I'd like for the user to submit the form and be redirected to the checkout page with the form values already filled.

I'm using Übercart and I think it's this function here that controls it:

function uc_checkout_pane_delivery($op, &$arg1, $arg2) and the values of $arg1 needs the be set by the previous form. My question is how? What would be an appropriate method for populating the checkout form fields? Thanks.


I think you could get away with this by using hook_form_alter (checkout is still a form) and just setting #default_value on the required field. The previous form could save it in $_SESSION somewhere.

| improve this answer | |
  • I just changed the form action to shop/checkout and used the $_POST values to insert the data in the checkout form. It works, but I'm not sure it's very safe/good coding. – user968416 Dec 13 '11 at 12:59

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.