Ordering Options to Cart Issue

Questions and answers about ShopSite Custom Templates

Ordering Options to Cart Issue

Postby posty27 » Tue Jan 25, 2011 4:09 pm

Is there a way to submit the Ordering Options of a product to the shopping cart without having the submit button wrapped in the <form> </form> tags?

Here's my page layout: http://www.lifeloc.com/store/accessories_new.html

See 1st column, 2nd Row:
As it is now, I can carry over the Ordering Options if I include the "Add to Cart" button within the <form></form> tags. I want to submit the options to the cart using the "Buy" button that is within the table below the Ordering Options.

I'm using Shopsite 10 Pro.

Product Template Code:
Code: Select all
[-- DEFINE PRODUCT --]

<!-- Format product as one column using CSS Divs -->

<div class="supply_outline">
<h2>[-- PRODUCT.Name --]</h2>
[-- IF Product.Graphic --][-- Product.Graphic --][-- END_IF --]
<p>[-- Product.ProductDescription --]</p>

<!-- For Products with Options -->
[-- IF PRODUCT.DisplayOrderingOptions --]
   <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 --]">
   [-- PRODUCT.OptionText --]
[-- Order_Option_Menu NoFormat --]
<input type="submit" value="Add to Cart">
</form>



   [-- END_IF --]

<table width="315" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th width="17%" scope="col">Item #</th>
    <th width="44%" scope="col">Description</th>
    <th width="24%" scope="col">Price</th>
    <th width="15%" scope="col">&nbsp;</th>
  </tr>

[-- IF PRODUCT.NumSubproducts 0 --]
<tr>
<td valign="top">[-- PRODUCT.SKU --]</td>
<td valign="top">[-- PRODUCT.Name --]</td>
<td valign="top">[-- PRODUCT.Price --]</td>
<td valign="top"><a href="[-- PRODUCT.AddToCartURL --]"><img src="http://www.lifeloc.com/staging_2/images/buy_button.jpg" class="table_img" border="0"></a></td>
</tr>

[-- ELSE --]
[--LOOP SUBPRODUCTS --]
[-- SUBPRODUCT --]
[-- END_LOOP SUBPRODUCTS --]
[-- END_IF --]

</table>
</div>

[-- END_DEFINE PRODUCT --]

[-- DEFINE SUBPRODUCT --]
  <tr>
    <td>[-- PRODUCT.SKU --]</td>
    <td>[-- PRODUCT.Name --]</td>
    <td>[-- PRODUCT.Price --]</td>
    <td><a href="[-- PRODUCT.AddToCartURL --]"><img src="http://www.lifeloc.com/staging_2/images/buy_button.jpg" class="table_img" border="0"></a></td>
  </tr>
[-- END_DEFINE SUBPRODUCT --]
posty27
 
Posts: 15
Joined: Tue Jan 26, 2010 8:26 am
Location: Denver

Re: Ordering Options to Cart Issue

Postby Jim » Tue Jan 25, 2011 4:33 pm

The submit button must be within the form tag for the form to work properly.

Order options will be displayed in the shopping cart whether or not they are displayed on the store page. So just don't include them on the page and the shopper will be able to make the selection in the cart. (Note you will need to make sure you have NOT checked the box to make option non-changeable in the cart. Commerce Setup > OrderSystem > Shopping cart > Ordering Options can not be changed )

You can use the ;n at the end of the first option in each list so that the shopper must make a selection before checking out.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 116 guests