Magento:不能在购物车价格规则的操作条件中使用属性权重



属性'weight'设置为 'yes' for "Use for Promo Rule Conditions" 。我可以在条件区域使用"Total Weight"。所以它被拿用于整个购物车。但我想将其用于操作条件(选项卡 "Action" )。可用于促销规则的所有属性都显示在第 "Product Attribute" 部分下。重量不存在。我还想要一些产品的"重量"作为行动条件。

(I use Magento 1.8.1.0)
我不知道

这是一个错误还是一个功能,但它就像你不能将weight属性用于规则条件和操作一样。
检查属性是否对规则有效时,将调用此方法 Mage_Catalog_Model_Resource_Eav_Attribute::isAllowedForRuleCondition

public function isAllowedForRuleCondition()
{
    $allowedInputTypes = array('text', 'multiselect', 'textarea', 'date', 'datetime', 'select', 'boolean', 'price');
    return $this->getIsVisible() && in_array($this->getFrontendInput(), $allowedInputTypes);
}

这个接缝是合理的。现在奇怪的部分。
权重属性具有前端输入weight
您可以通过在数据库上运行此查询来查看这一点。

SELECT * FROM eav_attribute where attribute_code = 'weight'. 

frontend_input更改为text会使该属性在促销规则中可用。但我不能告诉你这是否是一个好主意。

这里很晚了,但如果有人再次有这个问题,无法在 Shoppin 购物车价格规则中设置重量的原因是,默认情况下,如果您要更改"用于促销规则条件"的选项设置为 NO,则重量将显示为一个选项

最新更新