Author |
Topic |
|
seroom
Starting Member
New Zealand
27 Posts |
Posted - November 15 2004 : 00:23:48
|
Hi When customers checkout (shopcustomer.asp) we want to ask them what gender the gift is for (boy, girl or neutral) so suitable giftwrap can be used and also give them a field for a message. How is this done. Steve
|
|
eabrams
VP-CART New User
USA
72 Posts |
Posted - November 15 2004 : 07:33:31
|
You can edit he shopcustomerform.asp page and add the HTML form elements for the data you want to capture. See below for a gift e-card I added to one of our costomers cart...
Add code to shopcustomerform the subroutine shopshippingform. A check box is added under the shipping information.
.....
if getSess("isGift") = "ON" then response.write "<tr><td colspan='2'><br><b> To send a gift e-card to the recipient, check this box:</b> <input type='checkbox' name='isGift' value='ON' checked> </td></tr>" else response.write "<tr><td colspan='2'><br><b> To send a gift e-card to the recipient, check this box:</b> <input type='checkbox' name='isGift' value='ON'> </td></tr>" end if
.... Then in shopcustomer subroutine validateData you intercept the isGift checkbox and set a session variable for later use.
isGift = request.form("isGift") .....
ValidateCustCoupon setsess "isGift", isGift
Then process the record in shopformatorder.asp subroutine shopformatorder. this produces a hyperlink and adds data to orders table other1 field.
.... dim isGift, OrdersGift .... OpenOrder conn, oid ' pen orders and items
'EJA need to add is gift customer info here
isGift = getSess("isGift") 'response.write "-------" & isGift
if isGift = "ON" then response.write "<br><font size='5'><b>To send your gift e-card to the recipient, <a target='_blank' href='guestEmail.asp?fn=" & orders("ofirstname") & "&ln=" & orders("olastname") & "&e=" & orders("oemail") & "&sn=" & orders("oshipname") & "&oid=" & oid & "'>click here</a>.</b></font><br><br>"
'Flag gift Orders in database 1/3/2004 EJA strsql = "UPDATE orders SET orders.other1 = '1' WHERE (((orders.orderid)=" & oid & "))" Set OrdersGift = Server.CreateObject("ADODB.Recordset") OrdersGift.open strSQL, conn, adopenkeyset, adlockoptimistic 'closerecordset ordersGift
go to www.spws.net for my email. |
|
|
support
Administrator
4679 Posts |
Posted - November 15 2004 : 08:29:28
|
The previous code is all unnecessary. Simply set the following shop configuration values
xcustomerotherfields=Gender xcustomerothercaptions=Bot or Girl xcustomerfieldsinoder=Yes
VP-ASP generates all the code needed to display the form and update the database
VP-ASP Support
|
|
|
seroom
Starting Member
New Zealand
27 Posts |
Posted - November 15 2004 : 19:56:01
|
eabrams Thank you for taking the time to help out. Supports idea is a little simpler although not quite as formatted as I would like it, would prefer radio button on the gender question, we'll give it a go and see how it works.
Steve
|
|
|
eabrams
VP-CART New User
USA
72 Posts |
Posted - November 15 2004 : 20:47:40
|
Hey, we learn something every day.... Let me know how it works out...
go to www.spws.net for my email. |
|
|
Chuckles
Starting Member
3 Posts |
Posted - November 16 2004 : 10:41:45
|
I'm brand new to VPASP and am interested in doing a similar thing, although I need to ask for a lot of different information. Specifically, I'm selling services and need to compile additional information about the buyer including age, gender, race/ethnicity, primary language at home, etc.
I'm guessing that I will have to modify the Access database by adding these fields and then somehow link them back to the buyer's registration page? I've never done anything like that, so any specific help would be appreciated!
Charles
|
|
|
eabrams
VP-CART New User
USA
72 Posts |
Posted - November 16 2004 : 11:13:52
|
What do you want to do with the customers data once you have it? Is it for internal usage. If so you may need to add a new table linked to the customers table, then write the data to the new table.
I am not a big fan of making modifications to VPASP tables
http://www.spws.net |
|
|
Chuckles
Starting Member
3 Posts |
Posted - November 16 2004 : 23:45:14
|
Thanks for your response. Should I add the table to the main Access database? I'm not too familiar with Access databases, so I'm guessing that the table is just another page within the database with headers like: gender, age, school, etc. I'll buy a version of Access and open up the database to become more familiar with it. After I get that added, I'll just try to figure out how to reference it back to the registration page.
Thanks,
Charles
|
|
|
eabrams
VP-CART New User
USA
72 Posts |
Posted - November 17 2004 : 04:20:55
|
If you are not familiar with access databases and the VPASP code in general you may be looking for problems.
Give it a try, but be sure to test in a test environment.
http://www.spws.net |
|
|
seroom
Starting Member
New Zealand
27 Posts |
Posted - November 17 2004 : 19:41:07
|
Hi Eric It worked but not quite how I wanted it to. The two fields in question displayed as boxes as part of the customer information rather than a chekout question. this means that when a person is registering they are asked the two questions even though they have not purchased anything.
What I am wanting to do is add radio buttons that ask "what is the gender of the baby you are buying the present for so we can select the right packaging" and "What message do you want to include with the gift".
I am getting around this at the moment by usning langcreate06 and changing the caption to "In the box below please indicate Boy,Girl,Mother or N/a. <br> Also include a message and special comments.
This may do it.
Steve
|
|
|
|
Topic |
|