0
Heyhey, 나는 하나 개의 범주에서 모든 제품을로드하고 다른 범주 (그래서, 기본적으로, 단지 추가 카테고리에 모든 제품을 연결)에 추가하는 스크립트를 만들려고 해요젠토 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는 전에 colletion의 위해서 var_dump를 할 경우 당신은 무엇을 얻을? –