[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
Re: [ic] Asking more questions if a certain product is bought.
> Here's what I need to do... and any help on how would be very much
> appreciated!!
>
> Basically... If somebody buys something in a certain category, I need to
> have them fill out a form that is emailed to me. The information does not
> need to be stored in the database.
>
> Scenario:
>
There's probably a better way to do this using multi page checkout but we
always use a single page for checkout. So what I would do is have a field
in the database that flags when to display the extra fields.
Let's call it ask_info, set it to 1 in the db for the items that need the
additional info. Here is what it might look like:
[comment]
this code goes in the same place where the existing item-list shows up on
the checkout page
[/comment]
[set need_to_ask_info]0[/set]
[item-list]
[if item-field ask_info eq "1"]
[set need_to_ask_info]1[/set]
[/if]
[comment]
Do the normal stuff to show the basket on the checkout page
[/comment]
[/item-list]
[comment]
before the place order button put the following code
[/comment]
[if scratch need_to_ask_info eq "1"]
[error name=add_info_age std_label="Age: " required=1]
[error name=add_info_other std_label="Other: " required=1]
[/if]
Then in the etc/report access those values using [value add_info_age] [value
add_info_other] and it will be emailed to you along with the order.
This code hasn't been tested but it should give you an idea. Good luck!
-Ron