This code uses the toolkit counter function to create an add-all-to-basket category page. It's a simple list-layout with no sorting, pagination or filtering. A single button adds the selected quantity of each product to basket.
After the "Add All to Basket" button is clicked the user is directed to the home page. How can I get it to stay on the category page? I tried changing the action and old_screen values but if it returned to the category page it displayed the extended-layout and not the list-layout I'm using?
After the "Add All to Basket" button is clicked the user is directed to the home page. How can I get it to stay on the category page? I tried changing the action and old_screen values but if it returned to the category page it displayed the extended-layout and not the list-layout I'm using?
Code:
<div class="line-item"> <table> <tr class="header-row"> <td class="item-code"> Code </td> <td class="item-name"> Name </td> <td class="item-image"> Image </td> <td class="item-price"> Price </td> <td class="item-buttons"> </td> </tr> <form method="post" action="&mvt:global:sessionurl;"> <input type="hidden" name="Old_Screen" value="&mvte:global:Screen;" /> <input type="hidden" name="Old_Search" value="&mvte:global:Search;" /> <input type="hidden" name="Action" value="NEW" /> <input type="hidden" name="SubScreen" value="TKADPR" /> <input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;" /> <input type="hidden" name="Current_Product_Code" value="&mvte:global:Product_Code;" /> <input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;" /> <input type="hidden" name="Offset" value="&mvte:global:CatListingOffset;" /> <input type="hidden" name="AllOffset" value="&mvte:global:AllOffset;" /> <input type="hidden" name="CatListingOffset" value="&mvte:global:CatListingOffset;" /> <input type="hidden" name="RelatedOffset" value="&mvte:global:RelatedOffset;" /> <input type="hidden" name="SearchOffset" value="&mvte:global:SearchOffset;" /> <mvt:foreach iterator="product" array="category_listing:products"> <mvt:item name="toolkit" param="counter|current_nbr" /> <tr> <td class="item-code"><a href="&mvte:product:link;">&mvt:product:code;</a></td> <td class="item-name">&mvt:product:name; </td> <td class="item-image"><img src="&mvte:product:thumbnail;" alt="&mvte:product:name;" /></td> <td class="item-price">&mvt:product:formatted_price; </td> <td class="item-buttons" /> <input type="text" name="Quantity[&mvte:global:current_nbr;]" id="&mvt:product:id;" value="0" class="product-quantity-input textfield" /> <input type="hidden" name="Product_Code[&mvte:global:current_nbr;]" value="&mvt:product:code;" /> </td> </tr> </mvt:foreach> <tr> <td colspan="5" align="right"><input type="hidden" name="current_nbr" value="&mvt:global:current_nbr;" /> <input type="submit" value="Add All To Basket" class="button" /></td> </tr> </form> </table> </div>
Comment