Getting data into the cart when using Order Anywhere

General ShopSite user discussion

Getting data into the cart when using Order Anywhere

Postby meburdack » Fri Apr 30, 2010 7:13 am

Is there a way to get data/parameters into shopsite/shopping cart when using the "add to cart" buttons from Order Anywhere? Mark
meburdack
 
Posts: 9
Joined: Sun Mar 28, 2010 11:15 am
Location: usa

Postby Jim » Fri Apr 30, 2010 8:31 am

What kind of "data/parameters" are you wanting to send to the cart?

In addition to the product name and sku, you can pass a quantity, order option selections and the Customer Text Entry text. The price and Image (if used) will be pulled from the database when the item is added to the cart.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby meburdack » Fri Apr 30, 2010 9:23 am

We are going to sell downloadable products. the actual product file is static but their is a license file that is associated with the customer's device for which the product runs on. We would like to pass some info about the device through the cart and back out to our web page that deals with the license file. the Customer Text Entry text might work. where can I find more info? thanks Mark
meburdack
 
Posts: 9
Joined: Sun Mar 28, 2010 11:15 am
Location: usa

Postby Jim » Fri Apr 30, 2010 1:20 pm

Most of the info can be obtained by enabling the quantity and order options check boxes on the Product > Edit Product Layout screen and then going to the Merchandising > Order Anywhere screen to get the html needed. The option for the text entry field is not displayed in the html for order anywhere but can be added. (normally this would be in a custom template--see help for that at http://www.shopsite.com/help/10.1/en-US ... oduct.html in the section [-- PRODUCT.OptionsBox --] )
The name of the field is xx:freeopt where the xx is the product record number or the sku. Below is an example of how you would code an entire order anywhere form to include a descriptive title and the input field.

Code: Select all
<form action="http://yourdomain.com/sc/order.cgi" method=post>
<select name="774:finopt:0" size=1>
<option value="color;n">color
<option value="red">red
<option value="blue">blue
</select>
<select name="774:finopt:1" size=1>
<option value="size;n">size
<option value="large">large
<option value="small">small
</select>
<input type=hidden name="774:finoptnum" value=2>
<BR>Quantity <input type=text size="2" name="774:qnty" value="1" >
<br>Enter your product key here<br>
<textarea  name="774:freeopt" rows="1" cols="40"></textarea>
<input type=hidden name="storeid" value="*0a410385710603">
<input type=hidden name="dbname" value="products">
<input type=hidden name="function" value="add">
<input type=hidden name="itemnum" value="774">
<input type=image src="http://yourdomain.com/media/add_to_cart.gif" border="0" align="bottom" alt="Add to Cart" name="Add to Cart">
</form>

This example is using product with the record number 774. If you are using skus instead of record numbers replace all 774 entries with the sku of the product. You will also need to change the urls for the form submit and the add to cart button.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby meburdack » Tue May 11, 2010 4:29 am

Would specifying freeopt as an parameter to order.cgi, see below, also work?

http://yourdomain.com/sc/order.cgi?stor ... 4&freeopt=<productkey>&function=add

where <productkey> is the info we need to pass to the cart.

thanks
meburdack
 
Posts: 9
Joined: Sun Mar 28, 2010 11:15 am
Location: usa

Postby Jim » Tue May 11, 2010 8:47 am

The freeopt must have the item number followed by a : before it as in the modified url below.

Note: The < > are not allowed in the url passed to ShopSite like you have below but I assume that you meant that it was a changeable value.

The value of the nn:freeopt parameter will be displayed on the shopping cart screens in the text box associated with the product. So if that is a key to use the product and it is possible to get the product some other way, this would give the shopper a free key since they would be able to see it without actually purchasing the product.

Modified url with product number and : for freeopt parameter.
Code: Select all
http://yourdomain.com/sc/order.cgi?storeid=*0a410385710603&dbname=products&itemnum=774&774:freeopt=<productkey>&function=add
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby meburdack » Tue May 11, 2010 4:59 pm

that did the trick! thanks for your help, Mark
meburdack
 
Posts: 9
Joined: Sun Mar 28, 2010 11:15 am
Location: usa


Return to User Forum

Who is online

Users browsing this forum: No registered users and 122 guests

cron