webbusiness23 Posted August 2, 2010 Share Posted August 2, 2010 Hi,How can i hard code the default value "1" for product's quantity? I want to change this value from 1 to a bigger value.Thank you! 1 Link to comment Share on other sites More sharing options...
rocky Posted August 3, 2010 Share Posted August 3, 2010 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 More sharing options...
PresaExpert Posted August 3, 2010 Share Posted August 3, 2010 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.php2) 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 More sharing options...
webbusiness23 Posted August 3, 2010 Author Share Posted August 3, 2010 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.php2) 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 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