【问题标题】:How to add Free Shipping just for a City?如何为一个城市添加免费送货?
【发布时间】:2013-08-02 08:05:29
【问题描述】:

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

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

如何添加航运城市?

【问题讨论】:

    标签: magento magento-1.7


    【解决方案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;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多