Jump to content

Default quantity 1 when adding new product


joostvdk

Recommended Posts

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

 

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

  • 3 years later...

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

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

  • Like 1
Link to comment
Share on other sites

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

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...