This would be a 'multi add-to-cart' page where you can add multiple items to the cart with one add to cart button. In order to do this, instead of having an add to cart form for each product, you would start the add to cart form in the page template above all the products on the page, then end the add to cart form and include the add to cart button in the page template below all the products assigned to the page.
In the PAGE template, this code goes above the LOOP PRODUCTS tag:
- 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">
<!-- add this code for a basic table...don't include this code if you are using DIVs -->
<table>
In the PAGE template, this code goes below the LOOP PRODUCTS tag:
- Code: Select all
<!-- Add the closing table tag if you opened the table tag above...don't include the closing table tag if you are using DIVs -->
</table>
<input type="submt" value="Add to Cart">
</form>
Then, for this page template, you would want to force products on this page to use a specific product template that displays the products in the table-like structure of the example website you sent. In order to do this, find the [-- PRODUCTS --] tag, and add the name of the template you want to create, such as [-- PRODUCTS ART-Multi-Add.sst --]. Now you can go to Merchandising > Custom Templates > Page/Product Templates, and create a new product template that is called
ART-Multi-Add.sst.
In the PRODUCT template, you will want to include the form tags for any product options, the product quantity field, and the checkbox to add that product to the cart. Note, in order to
not have the checkbox you will need to add JavaScript to dynamicly check a hidden checkbox (or an equivalent function). In the DEFINE PRODUCT section of the product template, you would have something similar to this (note this is very simplified...you can beef this up as much as you want to get the look you are after).
- Code: Select all
[-- DEFINE PRODUCT --]
<tr>
<td>[--PRODUCT.Name--]</td>
<td>[-- IF PRODUCT.SaleAmount --]<strike>[--PRODUCT.Price--]</strike> [-- PRODUCT.SaleAmount --][-- ELSE --][-- PRODUCT.Price --][-- END_IF --]</td>
<td>Add? <input type="checkbox" name="itemnum" value="[-- PRODUCT.RECORDNUMBER --]"></td>
<td>Qnty <input type="text" size="2" name="[-- PRODUCT.RECORDNUMBER --]:qnty" value="1"></td>
<td>[-- IF PRODUCT.DisplayOrderingOptions --][-- PRODUCT.OptionText --] [-- ORDER_OPTION_MENU LINE --][-- END_IF --]</td>
</tr>
[-- END_DEFINE PRODUCT --]
Here is a template cookbook page that also talks about the basic set up for a multi add to cart page template:
https://www.shopsite.com/templates/cookbook/tips-multiaddtocart-page.shtml