Jump to content
Rubik Support

How to modify the default "Add Quantity" from 1 to anything?

Recommended Posts

In product pages, I can change the default quantity value from 1 to anything. But when i want to add quantity to it, it always add 1. I want to change it to 500. For example, every time someone click to add quantity button, he/she can add 500 to 1000 (Previous Quantity + 500 ), NOT 500 to 501 (+1)

Screen Shot 2018-11-16 at 5.25.01 PM.png

Share this post


Link to post
Share on other sites
7 minutes ago, Mugdho One said:

In product pages, I can change the default quantity value from 1 to anything. But when i want to add quantity to it, it always add 1. I want to change it to 500. For example, every time someone click to add quantity button, he/she can add 500 to 1000 (Previous Quantity + 500 ), NOT 500 to 501 (+1)

Screen Shot 2018-11-16 at 5.25.01 PM.png

Ok I see what you want, you can do it  from the template file by changing the default  increase  range.

Share this post


Link to post
Share on other sites
4 minutes ago, ndiaga said:

Ok I see what you want, you can do it  from the template file by changing the default  increase  range.

Can you be more specific... what file should i edit....

Share this post


Link to post
Share on other sites
2 minutes ago, Mugdho One said:

Can you be more specific... what file should i edit....

 

themes/classic/templates/catalog/_partials/product-add-to-cart.tpl 

 

You will see this code :

<div class="qty">
          <input
            type="text"
            name="qty"
            id="quantity_wanted"
            value="{$product.quantity_wanted}"
            class="input-group"
            min="{$product.minimal_quantity}"
            aria-label="{l s='Quantity' d='Shop.Theme.Actions'}"
          >
        </div>

 

Share this post


Link to post
Share on other sites
10 hours ago, joseantgv said:

But do you want to do the same increment for all the products?

No, Actually. I want separate increment for separate products.

Share this post


Link to post
Share on other sites
6 hours ago, Mugdho One said:

No, Actually. I want separate increment for separate products.

Then this is not an easy task.

Share this post


Link to post
Share on other sites
8 hours ago, ndiaga said:

Then this is not an easy task.

Well, I can work on incrementing all products (for now). How can i do that?

Share this post


Link to post
Share on other sites
50 minutes ago, Mugdho One said:

Well, I can work on incrementing all products (for now). How can i do that?

You have to create a table that will handle incrementation value of  each product based on id_product  

 
  •  

Share this post


Link to post
Share on other sites
On 11/29/2018 at 12:13 PM, Peter PANC said:

It was to be on a folder before the zip

Download this

 

panc_quantitymultiply.zip

Hi, Not working for me. I change the quantity in the prodcut, in the modules option, but nothing happens...

I'm using Prestashop 1.7.4.2.

Share this post


Link to post
Share on other sites
On 11/16/2018 at 12:45 PM, ndiaga said:

 

themes / classic / templates / catalogue / _partials / product-add-to-cart.tpl 

 

Vous verrez ce code :


 
          
            
            
            
            
            
            
            
          
        

 

 

Hi I will not answer this guy ( Rubik Support ) , given his writing, not even a hello, in addition to aggressive response, and not a thank you

Edited by Mosaïsme (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites
On 11/16/2018 at 2:45 PM, ndiaga said:

 

/ _Partials / ürün-add-to-cart.tpl temalar / klasik / templates / katalog 

 

Bu kodu göreceksiniz :


 
          
            
            
            
            
            
            
            
          
        

 

 

 

I will be very happy if you can write what we write instead of this code: D

Edited by oktayedes (see edit history)

Share this post


Link to post
Share on other sites
19 hours ago, oktayedes said:

 

 

I will be very happy if you can write what we write instead of this code: D

For example:

 

<!--- You have --->
<div class="qty">
          <input
            type="text"
            name="qty"
            id="quantity_wanted"
            value="{$product.quantity_wanted}"
            class="input-group"
            min="{$product.minimal_quantity}"
            aria-label="{l s='Quantity' d='Shop.Theme.Actions'}"
          >
        </div>
<!--- you should have-->
{assign var=custom_min_quantity   value=500}
{assign var=custom_quantity_wanted   value=($custom_min_quantity+500)}
<div class="qty">
          <input
            type="text"
            name="qty"
            id="quantity_wanted"
            value="{$custom_quantity_wanted}"
            class="input-group"
            min="{$custom_min_quantity}"
            aria-label="{l s='Quantity' d='Shop.Theme.Actions'}"
          >
        </div>

 

Share this post


Link to post
Share on other sites
On 5/28/2019 at 2:58 AM, ndiaga said:

For example:

 


<!--- You have --->
<div class="qty">
          <input
            type="text"
            name="qty"
            id="quantity_wanted"
            value="{$product.quantity_wanted}"
            class="input-group"
            min="{$product.minimal_quantity}"
            aria-label="{l s='Quantity' d='Shop.Theme.Actions'}"
          >
        </div>
<!--- you should have-->
{assign var=custom_min_quantity   value=500}
{assign var=custom_quantity_wanted   value=($custom_min_quantity+500)}
<div class="qty">
          <input
            type="text"
            name="qty"
            id="quantity_wanted"
            value="{$custom_quantity_wanted}"
            class="input-group"
            min="{$custom_min_quantity}"
            aria-label="{l s='Quantity' d='Shop.Theme.Actions'}"
          >
        </div>

 

 

this code worked in part, I got the minimum amount but the increase is not like 5-10-20

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More