Hi,
I am not very good at PHP however I am trying to edit a php function for Magento.
$categoryID = $this->getCategoryId(); //the value is like 7,3,6,9
$cats = explode(',', $categoryID);
$collection = Mage::getModel('catalog/product')
->getCollection()
->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
->addAttributeToSelect('*')
->addAttributeToFilter('category_id', array(
array('finset' => '7'),
array('finset' => '3'),
array('finset' => '6'),
array('finset' => '9')
)
);
I want to generate the below part automatically based on the value(s) of $cats
array('finset' => '7'), array('finset' => '3'),
array('finset' => '6'),
array('finset' => '9')
How can I do it, urgent help will be extremely appreciated.
Thanks in advance