Skip to main content

Posts

Showing posts from February, 2015
Combine products of 2 categories in to one category I created 4 categories. Category 1, 2 , 3, 4 all have 50 + 50 + 50 + 50 products, I created category 5 and category 6 , I want to add products of "category 1 & 2" to Category 5 I want to add products of "category 3 & 4" to Category 6. below is the solution for this in magento site. $category1Id = 1; $category2Id = 2; $category5Id = 5; //get the category instances $category1 = Mage::getModel('catalog/category')->load($category1Id); $category2 = Mage::getModel('catalog/category')->load($category2Id); $category5 = Mage::getModel('catalog/category')->load($category5Id); //get products from the first 2 categories $category1Products = $category1->getProductsPosition(); $category2Products = $category2->getProductsPosition(); //merge the products into one big array $merged = array_merge($category1Products, $category2Products); //assigned the merged products t