joostvdk Posted April 5, 2016 Share Posted April 5, 2016 Hi, Somebody knows how to make de quantity default to 1 when adding a new product in prestashop 1.6 ? Kind regards, Joost Link to comment Share on other sites More sharing options...
shokinro Posted April 6, 2016 Share Posted April 6, 2016 (edited) you can try to change following line in file /classes/Product.php from 0 to 1 to see if it works or not. /** @var int Quantity available */ public $quantity = 1; Please consider to use override class if you know how and do not want to modify the core file - this is the best/correct way to do. Edited April 6, 2016 by shokinro (see edit history) Link to comment Share on other sites More sharing options...
joostvdk Posted April 7, 2016 Author Share Posted April 7, 2016 you can try to change following line in file /classes/Product.php from 0 to 1 to see if it works or not. /** @var int Quantity available */ public $quantity = 1; Please consider to use override class if you know how and do not want to modify the core file - this is the best/correct way to do. Thanks. I tried it. But the product is still 0 when i add it. I also modified the field, so there is always a "1" in it. But on submitting. it is still 0. Looks like a javascript is overruling( i think) Link to comment Share on other sites More sharing options...
shokinro Posted April 7, 2016 Share Posted April 7, 2016 if that it the case, you can try to modify the quantity in following method in Product.php public function add($autodate = true, $null_values = false) { $this->quantity = 1; ..... Link to comment Share on other sites More sharing options...
mir-aus Posted August 29, 2019 Share Posted August 29, 2019 I have the same problem in PS1.7.6, any Idea to fix ? Link to comment Share on other sites More sharing options...
ApoA Posted August 29, 2019 Share Posted August 29, 2019 hello, have you guys tried editing the minimum quantity on catalog -> products -> select product, and look for quantity settings, there is a field that says "Minimum quantity for sale" Link to comment Share on other sites More sharing options...
mir-aus Posted August 29, 2019 Share Posted August 29, 2019 in this case, I have to pen 1700 itesm one by one to fix it ! oh MG Link to comment Share on other sites More sharing options...
ApoA Posted August 29, 2019 Share Posted August 29, 2019 (edited) hello, if you want to do it for all your product, then one solution is altering the database. on "ps_product_attribute" table there is a field "minimal_quantity", change every row value for this field to "1", just make an sql command like this, make sure it's the same table name for you UPDATE `ps_product_attribute` SET `minimal_quantity`= 1 Edited August 29, 2019 by ApoA (see edit history) Link to comment Share on other sites More sharing options...
mir-aus Posted September 2, 2019 Share Posted September 2, 2019 On 8/29/2019 at 3:43 PM, ApoA said: hello, if you want to do it for all your product, then one solution is altering the database. on "ps_product_attribute" table there is a field "minimal_quantity", change every row value for this field to "1", just make an sql command like this, make sure it's the same table name for you UPDATE `ps_product_attribute` SET `minimal_quantity`= 1 Thanks mate 1 Link to comment Share on other sites More sharing options...
ApoA Posted September 2, 2019 Share Posted September 2, 2019 your very welcome 😁 Link to comment Share on other sites More sharing options...
mir-aus Posted September 3, 2019 Share Posted September 3, 2019 On 8/29/2019 at 3:43 PM, ApoA said: hello, if you want to do it for all your product, then one solution is altering the database. on "ps_product_attribute" table there is a field "minimal_quantity", change every row value for this field to "1", just make an sql command like this, make sure it's the same table name for you UPDATE `ps_product_attribute` SET `minimal_quantity`= 1 Still, minimal_quantity also for some products are 0, is there any other table for that? Link to comment Share on other sites More sharing options...
mir-aus Posted September 3, 2019 Share Posted September 3, 2019 I am using PS 1.7.6 Link to comment Share on other sites More sharing options...
mir-aus Posted September 4, 2019 Share Posted September 4, 2019 (edited) I fond it : UPDATE `ps_product_shop` SET `minimal_quantity`= 1 and UPDATE `ps_product` SET `minimal_quantity`= 1 Edited September 4, 2019 by mir-aus (see edit history) 1 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