php - 按属性集筛选集合

标签 php magento

如何按属性集名称过滤集合

我正在尝试如下,但它不起作用

$collection->addAttributeToFilter('attribute_set_name',"Quantity Television Parts");

谢谢

最佳答案

这就是我最终的做法。

我在“eav_attribute_set”表中查找了属性集名称的 ID,并使用了以下过滤器:

$products->addAttributeToFilter('attribute_set_id','33');

关于php - 按属性集筛选集合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2436630/

相关文章:

php - 如何修复 Yii2 View 中的 "Undefined variable"错误?

Magento 命名约定

php - 在 JSON 中添加其他对象

php - 当 mysql 中的文件名包含 ' 时,附件不起作用

php - Laravel 播种机中的密码字段没有散列

php - Laravel Form 方法 VS 传统编码

magento - 如何将数据写入自定义字段中的 "sales_flat_order_payment"表?

mysql - Magento 和重新索引目录上的错误 1452(违反完整性约束)

magento - magento中覆盖和重写之间的区别

magento - 从 magento 模型集合中获取单个实体