geniusbobz Posted July 17, 2014 Share Posted July 17, 2014 How do i add the quantity option in the products archive/Grid so that visitor can buy in the category page. They just need to select the quantity then press add to cart. Link to comment Share on other sites More sharing options...
tomerg3 Posted July 17, 2014 Share Posted July 17, 2014 This requires some code changes, as the add to cart function needs to be modified to look for the new textbox you add (this may differ a bit based on the PS version / theme you use). If you are not comfortable making code changes, you can try this module (which also let you use attributes in product list pages). http://www.presto-changeo.com/en/attribute-modules/59-product-list-attributes.html Link to comment Share on other sites More sharing options...
geniusbobz Posted July 18, 2014 Author Share Posted July 18, 2014 Thanks for your reply. I've already implemented it by modifying product-list.tpl and ajax-cart.js. 1 Link to comment Share on other sites More sharing options...
developer_php Posted January 27, 2015 Share Posted January 27, 2015 please give me the file whatever you changed in 2 files Link to comment Share on other sites More sharing options...
klopotnik Posted February 3, 2015 Share Posted February 3, 2015 On 7/18/2014 at 6:09 AM, geniusbobz said: Thanks for your reply. I've already implemented it by modifying product-list.tpl and ajax-cart.js. would you like to share you 2 files? Link to comment Share on other sites More sharing options...
Shurek Posted February 6, 2015 Share Posted February 6, 2015 (edited) This is what i changed in the product-list.tpl : <select type="text" title="Aantal" name="Aantal" id="Aantal" class="{$product.id_product|intval}" style="width:auto;"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> </select> And in ajax-cart.js : around line 138 var minimalQuantity = $('.' + idProduct).val(); Hope it will help you [thanks to this forum i found a solution that it fills the select form item with available quantity] <select type="text" title="Quantity" name="Quantity" id="{$product.id_product|intval}" class="quantity" style="width:auto;"> {for $foo=0 to $product.quantity} <option value="{$foo}">{$foo}</option> {/for} </select> Edited March 6, 2015 by Shurek (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now