Jump to content

Add Product Quantity in Category page Prestashop 1.6


Recommended Posts

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

  • 6 months later...

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 by Shurek (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...