4

How Set Manage Stock as no in the magento, i have used this code but manage stock showing as yes

            $_product->setStockData(array( 
                'manage_stock' => 0,
                'use_config_notify_stock_qty' => 0
            )); 

but when use

            $_product->setStockData(array( 
                'is_in_stock' => 1, 
                'qty' => 9999,
                'manage_stock' => 0,
                'use_config_notify_stock_qty' => 0
            )); 

the quantity and is_in_stock status has been update but manage stock not setting as no.

what is the problem?

16

Check your value for use_config_manage_stock, it could be defaulting to that default value, so you'll want to set use_config_manage_stock to 0 as well as manage_stock to 0 too, depending on your settings.

$_product->setStockData(array( 
            'use_config_manage_stock' => 0,
            'is_in_stock' => 1, 
            'qty' => 9999,
            'manage_stock' => 0,
            'use_config_notify_stock_qty' => 0
        )); 
$_product->save();
  • 1
    Great to know Helphin, would ya mind clicking the tick mark to accept it as an answer if it's helping you? :) – Moose Feb 12 '14 at 13:49
  • 2
    its done, just waited for required time, once again thanks – Helphin Feb 12 '14 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.