Quantity input field

Questions and answers about ShopSite Custom Templates

Quantity input field

Postby jackie » Sun Jun 27, 2010 9:37 pm

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 --]
jb
jackie
 
Posts: 31
Joined: Mon Mar 12, 2007 12:41 pm

Postby Jim » Mon Jun 28, 2010 6:15 am

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
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby jackie » Mon Jun 28, 2010 7:11 am

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 --]
jb
jackie
 
Posts: 31
Joined: Mon Mar 12, 2007 12:41 pm

Postby BFChris » Mon Jun 28, 2010 8:17 am

I believe the "name" for the quantity input box should be

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


not

Code: Select all
[-- PRODUCT.DisplayOrderQuantity --]
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 41 guests

cron