Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Adding extra field sto checkout
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

seroom
Starting Member

New Zealand
27 Posts

Posted - November 15 2004 :  00:23:48  Show Profile  Reply with Quote
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  Show Profile  Visit eabrams's Homepage  Reply with Quote
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.
Go to Top of Page

support
Administrator

4679 Posts

Posted - November 15 2004 :  08:29:28  Show Profile  Visit support's Homepage  Reply with Quote
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


Go to Top of Page

seroom
Starting Member

New Zealand
27 Posts

Posted - November 15 2004 :  19:56:01  Show Profile  Reply with Quote
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

Go to Top of Page

eabrams
VP-CART New User

USA
72 Posts

Posted - November 15 2004 :  20:47:40  Show Profile  Visit eabrams's Homepage  Reply with Quote
Hey, we learn something every day.... Let me know how it works out...

go to www.spws.net for my email.
Go to Top of Page

Chuckles
Starting Member

3 Posts

Posted - November 16 2004 :  10:41:45  Show Profile  Reply with Quote
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


Go to Top of Page

eabrams
VP-CART New User

USA
72 Posts

Posted - November 16 2004 :  11:13:52  Show Profile  Visit eabrams's Homepage  Reply with Quote
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
Go to Top of Page

Chuckles
Starting Member

3 Posts

Posted - November 16 2004 :  23:45:14  Show Profile  Reply with Quote
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

Go to Top of Page

eabrams
VP-CART New User

USA
72 Posts

Posted - November 17 2004 :  04:20:55  Show Profile  Visit eabrams's Homepage  Reply with Quote
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
Go to Top of Page

seroom
Starting Member

New Zealand
27 Posts

Posted - November 17 2004 :  19:41:07  Show Profile  Reply with Quote
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


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00