Jump to content

[SOLVED] BO -- change default product quantity


Recommended Posts

To change the default quantity on the product page from 1 to another value, change line 258 of product.tpl in your theme's directory (in PrestaShop v1.3.1):

<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" />



Change the 1 in {else}1{/if} to whatever you want the default quantity to be.

Link to comment
Share on other sites

Do you mean to change the products quantities at front end or at admin?
At front end the above method given by rocky will work.
And if you need at admin side when you are adding a new product then follow the following method.
1) Open file yoursiteadmin/tabs/AdminProduct.php
2) Go to line 1370, you will

if ($qty === false) {
if (Validate::isLoadedObject($obj))
$qty = $this->getFieldValue($obj, 'quantity');
else
$qty = 1;
$qty_state = '';
}

modify $qty=1 to what ever value you need.

Link to comment
Share on other sites

I forgot to mention that i was talking about the BO.
Thank you!

Solved!


Do you mean to change the products quantities at front end or at admin?
At front end the above method given by rocky will work.
And if you need at admin side when you are adding a new product then follow the following method.
1) Open file yoursiteadmin/tabs/AdminProduct.php
2) Go to line 1370, you will

if ($qty === false) {
if (Validate::isLoadedObject($obj))
$qty = $this->getFieldValue($obj, 'quantity');
else
$qty = 1;
$qty_state = '';
}

modify $qty=1 to what ever value you need.
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...