Magento 集合过滤器

标签 magento

在magento集合中,我想使用“store”属性过滤值。我在数组中有一些值。基于该数组,我需要过滤值。但以下两个功能都不起作用。

$collection->addAttributeToFilter('store',array('in' => array(1,2,3)));
$collection->addFilter('store',array('in' => array(1,2,3));

还有其他方法可以让它发挥作用吗?

最佳答案

$collection->addFieldToFilter('stores', array('in' => array(1,2,3)));

addFieldToFilter 完成了这项工作:)

关于Magento 集合过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12724192/

相关文章:

magento - 使用设置脚本在 Magento 中添加自定义产品属性

magento - 如何设置最低采购订单金额

magento - Magento 中的保存需要很长时间

css - 来自自定义皮肤的 Magento css 通过 addCss

Magento 将产品集合加入到自定义属性的自定义表中

用于启动画面的 Magento 路由器

php - 为什么我无法使用谷歌浏览器登录到 magento 后端

mysql - 更改数据库密码后如何连接到 Magento?

magento - PayPal 在 PayPal 端向 Magento Cart 添加额外税费

php - 如何通过Magento中的 Controller 将数组中的多个数据插入数据库