Page 1 of 1

Quantity input field

PostPosted: Sun Jun 27, 2010 9:37 pm
by jackie
Hi,

So far i have been unable to get a quantity input field to work on my site using a custom template. I am using SS10 pro.

Here is the code that I have most recently tired, the add to cart is working and the Quantity input field is showing on the page, but it still only adds one product to the cart, The quantity isn't working. If anyone out there knows what I am doing wrong, I would love to hear about it, i cannot find much info on this in the help section.

#if a Quantity is required generate the quantity box
[-- IF product.DisplayOrderQuantity? --]
<span style="color:#901C1D;
font-family:Arial,Helvetica,sans-serif;
font-size:10px;" align="right">Qty </span><input type=text size=2 name="[-- PRODUCT.DisplayOrderQuantity --]" value="1">
[-- END_IF --]

<a href="[-- PRODUCT.AddToCartURL --]">
[-- IF AddImage? --]
<img [--AddImage--]></a>
[-- ELSE --]
[-- AddText --]</a>
[-- END_IF --]

PostPosted: Mon Jun 28, 2010 6:15 am
by Jim
When you use the quantity box or order options you need to use a form to submit the items rather than just an <a href ...>

Check out the sample code in the ShopSite help. Here is a link to the ordering option section that shows how a form would be used.
http://www.shopsite.com/templates/examp ... tions.html

PostPosted: Mon Jun 28, 2010 7:11 am
by jackie
Thanks for your reply Jim,

When I use the code below, the form only submits 1 item to the cart even though I put 7 in the quantity input field. I cannot seem to figure out what I am doing wrong here.

[-- IF product.DisplayOrderQuantity --]
<form action="[-- SHOPPING_CART_URL Base --]/order.cgi" method="post">
<input type="hidden" name="storeid" value="[-- STORE.ID --]">
<input type="hidden" name="dbname" value="products">
<input type="hidden" name="function" value="add">
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
Qty:<input type=text size=2 name="[-- PRODUCT.DisplayOrderQuantity --]" value="1" >
<input type="submit" value="[-- PRODUCT.AddToCartButton --]">
</form>
[-- ELSE --]
<a href="[-- PRODUCT.AddToCartURL --]">Add to Cart</a>
[-- END_IF --]

PostPosted: Mon Jun 28, 2010 8:17 am
by BFChris
I believe the "name" for the quantity input box should be

Code: Select all
[-- PRODUCT.RecordNumber --]:qnty


not

Code: Select all
[-- PRODUCT.DisplayOrderQuantity --]