如何使用指定的product_id / entity_id添加新产品?
$newprod = new Mage_Catalog_Model_Product();
$newprod->setProductId( 100 ); // how do i make this work
$newprod->setSku(... );
答案 0 :(得分:0)
$product = Mage::getModel('catalog/product')->load($desiredId); if(!$product){ //here also might be something like $product->getSku() $product->set.......//set required fields here $product->setEntityId($desiredId); //we won't mess up things, because product with desired id et not exists $product->save() }