Search code examples
phpmagentomarketplace

In Magento there is any code in marketpalce seller when adding product to automatic disable it?


I am using a marketplace when seller is adding any products then it becomes enable and live there is any code to add in seller add product page to when seller add new products then it becomes to disable then admin approve it.


Solution

  • Yes. its is possible.

    You have not share any code. so I just told you that how you become of your goal.

    You need to set product status set to 2 or disabled before it save.

    Something like that

    $product = Mage::getModel('catalog/product');
    $product->setStatus(2) //product status (1 - enabled, 2 - disabled) 
    $product->save();
    

    See the perfect tutorial for

    Programmatically (manually) creating simple Magento product

    Programmatically create a configurable Magento product