Prestashop 1.7.4.2-基于最终总价的免费运输

Prestashop 1.7.4.2-基于最终总价的免费运输,prestashop,prestashop-1.7,prestashop-helper-classes,Prestashop,Prestashop 1.7,Prestashop Helper Classes,我需要申请折扣后的运费计算 例如 购物车总数:65$ 免费送货开始:65美元 折扣:5% 打折后价格低于65美元,仍可免费送货 我需要它在发货前计算折扣首先按承运人设置您的范围(0-65:X欧元,高于65:0欧元) 对类Cart.php进行重写 重写函数getPackageShippingCost 下线 //以默认货币表示的订单总额,不含费用 $order\U total=$this->getOrderTotal(true,购物车::两个\u都没有配送,$product\u列表); 加上这个

我需要申请折扣后的运费计算

例如
购物车总数:65$
免费送货开始:65美元
折扣:5%

打折后价格低于65美元,仍可免费送货
我需要它在发货前计算折扣

首先按承运人设置您的范围(0-65:X欧元,高于65:0欧元)

对类Cart.php进行重写

重写函数getPackageShippingCost
下线

//以默认货币表示的订单总额,不含费用
$order\U total=$this->getOrderTotal(true,购物车::两个\u都没有配送,$product\u列表);
加上这个

替换


清除缓存并运行

首先按运营商设置范围(0-65:X欧元,高于65:0欧元)

对类Cart.php进行重写

重写函数getPackageShippingCost
下线

//以默认货币表示的订单总额,不含费用
$order\U total=$this->getOrderTotal(true,购物车::两个\u都没有配送,$product\u列表);
加上这个

替换

清除缓存并运行

ty这么多:)很晚,但此答案与我解决它时所做的相同:)ty这么多:)很晚,但此答案与我解决它时所做的相同:)
//Recalcul total pour panier et livraison gratuite 
$listeDiscounts = $this->getCartRules();        
$total_discounts = 0;
if (is_array($listeDiscounts)) {
    if (isset($listeDiscounts[0]['value_real']))
        $total_discounts = $listeDiscounts[0]['value_real'];            
}
$price_to_apply_shipment = floatval($order_total) - floatval($total_discounts);
//$check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $total_order, (int)$id_zone, (int)$this->id_currency);
by                    
$check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $price_to_apply_shipment, (int)$id_zone, (int)$this->id_currency);
//$shipping_cost += $carrier->getDeliveryPriceByPrice($the_total_price, $id_zone, (int)$this->id_currency);
By 
$shipping_cost += $carrier->getDeliveryPriceByPrice($price_to_apply_shipment, $id_zone, (int)$this->id_currency);