0
Heyhey,Magento的1.6副本類產品
我試圖讓一個腳本,將加載所有的產品從一類,並將其添加到其他的類別(所以,基本上,只是鏈接的所有產品,其他類別) 。我想要的是:
$category = Mage::getModel('catalog/category');
$category->load($id); // Preset category id
$collection = $category->getProductCollection();
$collection->addAttributeToSelect('*');
foreach ($collection as $product) {
$result[] = $product->getProductId();
// Now get category ids and add a specific category to them and save?
}
$結果出現空,我不知道如何繼續。有任何想法嗎?
,如果你在foreach之前做總彙的的var_dump你得到了什麼? –