Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 Magento 中克隆产品模型/对象实例?基本上,我正在关注产品的保存事件,并希望根据主产品自动创建子产品。除了 SKU 和属性外,这些信息基本相同。我试过这个:
$product = clone $parent_product; $product->setName('I am testing'); $product->save();
但它不起作用。有任何想法吗?
我觉得你需要看看Mage_Catalog_Model_Product->duplicate()
Mage_Catalog_Model_Product->duplicate()