Prestashop 1.6 - 根据最终总价格

时间:2016-06-01 18:03:37

标签: prestashop shipping price

我正在使用prestashop 1.6。我的网站提供"免费送货"购买超过80美元。我的网站也推广了#34;买1送1"。

现在,一件商品的成本约为<60美元,我坚持要求客户购买同一类别的2件商品,以便有权购买1件1.

如果客户购买一件产品,则应该花费60美元(不含免费送货,因为最终价格<80)

如果客户购买2 = 120美元,但在&#34;买1送1&#34;促销,最终总价格是60.所以通过权利,这个客户没有免费送货,但我的网站免费送货给这个客户,因为&#34;免费送货&#34;逻辑是基于打折前的总价格(120美元)。

我该如何解决这个问题?我希望免费送货计算基于最终总价(打折后)

click here to view print screen

1 个答案:

答案 0 :(得分:0)

您必须从getPackageShippingCost()覆盖方法Cart.php

并改变这些界限:

    } else {
        if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT) {
            $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight($product_list), $id_zone);
        } else { // by price
            $shipping_cost += $carrier->getDeliveryPriceByPrice($order_total, $id_zone, (int)$this->id_currency);
        }
    }
} else {
    if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT) {
        $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight($product_list), $id_zone);
    } else {
        $shipping_cost += $carrier->getDeliveryPriceByPrice($order_total, $id_zone, (int)$this->id_currency);
    }
}

$order_total替换为$orderTotalwithDiscounts

    } else {
        if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT) {
            $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight($product_list), $id_zone);
        } else { // by price
            $shipping_cost += $carrier->getDeliveryPriceByPrice($orderTotalwithDiscounts, $id_zone, (int)$this->id_currency);
        }
    }
} else {
    if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT) {
        $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight($product_list), $id_zone);
    } else {
        $shipping_cost += $carrier->getDeliveryPriceByPrice($orderTotalwithDiscounts, $id_zone, (int)$this->id_currency);
    }
}

如果您不知道如何覆盖课程,请查看this documentation