Changing product ID in signup.php based on user's selection

Discussion in 'Customization & add-ons' started by spencerbrooks, Jun 16, 2011.

  1. spencerbrooks

    spencerbrooks New Member

    Joined:
    Jun 16, 2011
    Messages:
    2
    I am attempting to alter the product ID associated with a user after they submit the signup form. The decision is based on what I believe is a custom field (forgive me for being a little slow--I inherited this site from a previous developer who set everything up). I have the basic logic in place:

    PHP:
    if ($vars['i_am_a'] == "person with diabetes" || $vars['i_am_a'] == "parent/caregiver of a person with diabetes") {
        
    $vars['product_id'] = 3;
    } else if (
    $vars['i_am_a'] == "healthcare professional" || $vars['i_am_a'] == "member of industry" || $vars['i_am_a'] == "other") {
        
    $vars['product_id'] = 6;
    }
    My question is where to place this logic in the flow of signup.php...I currently have it placed at the very bottom above show_payment_form(); and while I can confirm my logic is working successfully, the code doesn't change the product ID. This is a free product if that helps any. It appears the original code has been modified quite a bit, but any direction on the flow of events after a user submits the signup form would be helpful.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
  3. spencerbrooks

    spencerbrooks New Member

    Joined:
    Jun 16, 2011
    Messages:
    2
    Thanks alexander, I will have a look!

Share This Page