1

我为购物车创建了一条规则,为某个地区/州提供免费送货服务。问题是我只需要一个城市的免费送货。

在这里,我有下一个属性航运邮政编码、航运地区、航运州/省、航运国家。

如何添加航运城市?

4

1 回答 1

1

找到了答案:

用一些本地模块重写 /app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php 文件并更改这些行

public function loadAttributeOptions()
{
$attributes = array(
    'base_subtotal' => Mage::helper('salesrule')->__('Subtotal'),
    'total_qty' => Mage::helper('salesrule')->__('Total Items Quantity'),
    'weight' => Mage::helper('salesrule')->__('Total Weight'),
    'payment_method' => Mage::helper('salesrule')->__('Payment Method'),
    'shipping_method' => Mage::helper('salesrule')->__('Shipping Method'),
    'postcode' => Mage::helper('salesrule')->__('Shipping Postcode'),
    'region' => Mage::helper('salesrule')->__('Shipping Region'),
    'region_id' => Mage::helper('salesrule')->__('Shipping State/Province'),
    'country_id' => Mage::helper('salesrule')->__('Shipping Country'),
);
$this->setAttributeOption($attributes);
return $this;
} 

public function loadAttributeOptions()
{
    $attributes = array(
        'base_subtotal' => Mage::helper('salesrule')->__('Subtotal'),
        'total_qty' => Mage::helper('salesrule')->__('Total Items Quantity'),
        'weight' => Mage::helper('salesrule')->__('Total Weight'),
        'payment_method' => Mage::helper('salesrule')->__('Payment Method'),
        'shipping_method' => Mage::helper('salesrule')->__('Shipping Method'),
        'postcode' => Mage::helper('salesrule')->__('Shipping Postcode'),
        'region' => Mage::helper('salesrule')->__('Shipping Region'),
        'region_id' => Mage::helper('salesrule')->__('Shipping State/Province'),
        'country_id' => Mage::helper('salesrule')->__('Shipping Country'),
        'city' => Mage::helper('salesrule')->__('Shipping City'),
    );
    $this->setAttributeOption($attributes);
    return $this;
}
于 2013-08-02T08:59:41.853 回答