Support Database
Subject: | Integration: Your Cart (Advanced) |
Category: | |
Keywords: | shopping cart, quantity, multiple regcode, registration code, multiple, quantity |
| |
Article: | If your shopping cart allows users to add items, change quantity and purchase multiple items at a time you may want to integrate SoftLocker with your shopping cart. This will require two things:
1) Adding SoftLocker Product IDs to your database 2) Generating a registration link on the fly using the information from the customer's cart
First open the SoftLocker Client and visit the Products section. Make note of the Product ID for each product, then associate it with the matching product in your website's product database.
When someone checks out you build a registration link on the fly using the SoftLocker product IDs, and SoftLocker will provide a registration code for each product ID that you send. You can also specify the quantity in the link.
For more information you should read the following sections of the SoftLocker Help File:
Advanced: Generating Your Own Links, and its subsection Bundling Products
We recommend that you generate a sample link that bundles products together. To do so, add more than one product in the Products section. Then click the Links button and the Add button to add a new link.
Select a product from the drop down list, and in the "Bundle With" section select a different product. Change the quantity of the bundled product and click the "Add" button.
You will now see a sample link in the "Generated Link" field that will look something like this:
http://www.softlocker.net/LDCA.asp?c=91&p=bWsg&s=1235s1624&q=1s3&l=we7iBy&ex=0&e=1&b=1&m=0&ar=0&r=db&as=0
The parts of the link you will need change are in bold above. s= indicates the product IDs and q= indicates the quantity. Each product and its associated quantity are separated by a lowercase "s".
After each order you will need to build those parts of the link based on your shopping cart contents. Here is an example and some psuedo-code for doing so:
Product Number | SoftLocker ID 1|192 2|193 3|253 4|392 5|954
In this example you have 5 products, number 1-5, but the customer is only buying products 1, 3 and 5. Additionally, they want 6 copies of product 3 but only 1 copy of the other products:
dim strEmail, strProducts, strQuantity strEmail = "mike@rebrandsoftware.com" strProducts = "192s253s954" strQuantity = "1s6s1"
strLink = "http://www.softlocker.net/LDCA.asp?c=233&p=bWsg&s=" + strProducts + "&q=" + strQuantity + "&l=we7iBy&ex=0&e=0&b=1&m=0&ar=0&r=db&as=0&email=" + strEmail
You would end up with a link that looked like this:
http://www.softlocker.net/LDCA.asp?c=233&p=bWsg&s=192s253s954&q=1s6s1&l=we7iBy&ex=0&e=0&b=1&m=0&ar=0&r=db&as=0&email=mike@rebrandsoftware.com
You could then redirect your customer to that URL after their successful purchase, and they would receive a total of 8 registration codes.
Here is some additional pseudocode that shows how you might assemble the product ID and Quantity strings from your database:
for each item in my shopping cart strProducts = strProducts & database("softlocker_id") & "s" strQuantity = strQuantity & database("product_quantity") & "s" next strProducts = left(strProducts, len(strProducts) - 1) (this gets rid of the trailing S) strQuantity = left(strQuantity, len(strQuantity) - 1) (this gets rid of the trailing S)
strEmail = customerdatabase("cust_email")
strLink = "http://www.softlocker.net/LDCA.asp?c=233&p=bWsg&s=" + strProducts + "&q=" + strQuantity + "&l=we7iBy&ex=0&e=0&b=1&m=0&ar=0&r=db&as=0&email=" + strEmail
You may also want to have your server contact ours and generate the code, instead of sending your customer to a link. For more information see:
http://www.softlocker.net/showsupport.asp?article_id=174 |
|
Home - SoftLocker.net Client - SoftLocker ListBuilder - Tutorials - Support - Privacy - Affiliates
© 2009-2010 SoftLocker.net