문제

In magento 1.9 I need to set the default qty value to 100 and Stock Availability to blank while creating a duplicate product.

So when a user duplicates a product, he should see qty value as 100 and Stock Availability as blank within inventory tab.

도움이 되었습니까?

해결책

To achieve this I have copied the following file app/code/core/Mage/Catalog/Model/Product.php to app/code/local/Mage/Catalog/Model/Product.php

And added the following code inside duplicate() method just before $newProduct->save(); line:

 $newProduct->setStockData(
   array( 
          'is_in_stock' => 3, 
          'qty' => 100,
   )
 );
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top