/rai Posted September 22, 2016 Share Posted September 22, 2016 (edited) I'm doing a script to import products and need to know what is the field that is activated in the database, activating the box -> When no stock, Allowing orders. this method does not work https://www.prestashop.com/forums/topic/71738-what-is-the-purpose-of-out-of-stock-field-in-the-product-table/ Edited September 25, 2016 by /rai (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted September 23, 2016 Share Posted September 23, 2016 It's the out_of_stock column in the ps_product table that stores that value. Set it to 0 for "Deny orders", 1 for "Allow orders" or 2 for "Default". 1 Link to comment Share on other sites More sharing options...
/rai Posted September 23, 2016 Author Share Posted September 23, 2016 (edited) It's the out_of_stock column in the ps_product table that stores that value. Set it to 0 for "Deny orders", 1 for "Allow orders" or 2 for "Default". I tried manually in the database and using the function: function loadProductsPost() { $_POST = array( 'tab' => 'AdminImport', 'skip' => '0', 'csv' => 'xxxxx.csv', 'forceIDs' => '1', 'match_ref' => '0', 'convert' => '', 'entity' => '1', 'separator' => ';', 'multiple_value_separator' => '¬', 'iso_lang' => 'ES', 'import' => 'Importar datos CSV', 'type_value' => array( 0 => 'id', 1 => 'category', 2 => 'reference', 3 => 'quantity', 4 => 'weight', 5 => 'image', 6 => 'price_tex', 7 => 'name', 8 => 'description_short', 9 => 'out_of_stock', 10 => 'available_later', ), ); } But it does not work. I have also tried to modify the back-end but OUT_OF_STOCK field does not change, it is always the text 2. Instead avaiable_later if it works. Version prestashop 1.6.1.1 Edited September 23, 2016 by /rai (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted September 24, 2016 Share Posted September 24, 2016 Oh, you're right. I just checked and I discovered it's the out_of_stock field in the ps_stock_available table that is used, not the one in ps_product. 1 1 Link to comment Share on other sites More sharing options...
/rai Posted September 25, 2016 Author Share Posted September 25, 2016 Oh, you're right. I just checked and I discovered it's the out_of_stock field in the ps_stock_available table that is used, not the one in ps_product. It works thanks. 2 Link to comment Share on other sites More sharing options...
PatriceJV Posted November 12, 2023 Share Posted November 12, 2023 So what is the purpose of the out_of_stock column in the ps_product ? 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