Jump to content

Enable out of stock order when importing products


Recommended Posts

Is there a way to enable orders for out of stock products when importing the CSV file ? I have enabled ordering of out stock in preferences, but I have to manually enable this option for each product in the quantity tab. Is there a way to set it automatically for all new products ? 

Link to comment
Share on other sites

  • 3 weeks later...

I think this is a bug.

 

At least in version 1.6.0.11, the CSV import sets the out-of-stock-behavior to "Deny orders", whereas on 1.5.3.1 that I started out with, the CSV import sets this option to "Default (as set in Preferences).

 

I don't know whether this has been fixed or not in later versions (1.6.0.12+). Possibly not...

Edited by parsifal (see edit history)
Link to comment
Share on other sites

Odd, given the code, it's supposed to assign the current value out of the csv.

 

Try modifying this, in AdminImportController
 

			if ($product->getType() == Product::PTYPE_VIRTUAL)
				StockAvailable::setProductOutOfStock((int)$product->id, 1);
			else
				StockAvailable::setProductOutOfStock((int)$product->id, (int)$product->out_of_stock);

And setting it to

 

			if ($product->getType() == Product::PTYPE_VIRTUAL)
				StockAvailable::setProductOutOfStock((int)$product->id, 1);
			else
				StockAvailable::setProductOutOfStock((int)$product->id, 1);

Not sure it will work though

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