Jump to content

[SOLVED]When no stock, allowing orders, database field


/rai

Recommended Posts

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

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

  • 5 years later...
  • 1 year later...

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