Coding

Magento: How to set a product to be in/out of stock programatically

$product = Mage::getModel('catalog/product')->load( 'id' );

 
$stockItem = $product->getStockItem();
$stockItem->setData('manage_stock', 1);
$stockItem->setData('is_in_stock', 0);
$stockItem->setData('use_config_notify_stock_qty', 0);
$stockItem->setData('qty', 0);
 
$stockItem->save();
$product->save();

0 Bình luận

Trở về
  • HTML5 Canvas
  • HTML5 Canvas

     The <canvas> element is used to draw graphics, on the fly, on a web page. Draw a red rectangle, a gradient rectangle,...