我正在尝试使用属性和值数组过滤productCollection,但它显示错误,下面是我的代码。请让我知道如何做到......
$requestParams = $this->getRequest()->getParam('requestParams');
$shoppingBy = $requestParams["shoppingBy"];
$attributeCodes = array_keys($shoppingBy);
$productCollection = Mage::getModel("catalog/category")
->load($requestParams['categoryId'])
->getProductCollection();
foreach($attributeCodes as $attributeCode) {
$attributeValue = $shoppingBy[$attributeCode];
$filter = array('attribute' => $attributeCode, 'in' => $attributeValue);
$productCollection = $productCollection->addAttributeToFilter($filter);
}