First post in this forum. Bought ShopSite Pro about 3 weeks ago, and I've been very pleased with it. Many of the posts in the forum have helped me a great deal.
Here's my issue: On certain MoreInfo pages, I want to have the following:
- - A dropdown box that lets the user select a Subproduct
- A Quantity box
- The add to cart button
The code I've used works properly if the user selects the first item in the dropdown list. However, if any other item in the list is selected, "1" of that item is added to the cart, regardless of what is entered in the Quantity input box.
- Code: Select all
<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>
<TABLE style="margin-left: auto; margin-right: auto;">
<TR><TD>
[-- IF PRODUCT.SubProduct --]
<p>
Select Length:
</p>
<SELECT name="itemnum">
[-- LOOP SUBPRODUCTS --]
[-- SUBPRODUCTS --]
[-- END_LOOP SUBPRODUCTS --]
</SELECT>
Quantity <input type="text" size="2" name="[-- PRODUCT.RECORDNUMBER --]:qnty" value="1">
[-- ELSE_IF PRODUCT.QuantityPricing--]
[-- PRODUCT.QuantityPricing --]
<input type=hidden name=itemnum value=[-- PRODUCT.RecordNumber --]>
Quantity <input type="text" size="2" name="[-- PRODUCT.RECORDNUMBER --]:qnty" value="1"></center>
[-- ELSE --]
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
[-- PRODUCT.Price --]
Quantity <input type="text" size="2" name="[-- PRODUCT.RECORDNUMBER --]:qnty" value="1"></center>
# end the IF PRODUCT.subproducts
[--END_IF--]
<br><br>
########################
# ADD TO CART #
########################
<div align="center">
<input type=image src="http://www.expcomm.com/media/buttons/deepred_addtocart.jpg" alt="add_to_cart.gif" name="Add to Cart" alt="Add to Cart">
</div>
</form>
The code works perfectly when the ELSE_IF (Quantity pricing) and ELSE (no quantity or subproduct options) sections are called, but fails when the IF Product.Subproduct section is called. I would bet my problem has something to do with
name="[-- PRODUCT.RECORDNUMBER --]:qnty"
referencing the current product page rather than the dropdown box.
Other than that I am at a total loss. Any suggestions are greatly appreciated!
Thanks,
Mike