0
在我的控制器中,我有shipping.I'm的成本价值试图发送到getOrderShippingCost
函数。但我的车出航运free
如何在prestashop载体模块开发中插入不同的运输成本
Controller.php这样
$cost_val=120; //this value can be change
include_once(_PS_MODULE_DIR_.'delivery_scheduler/delivery_scheduler.php');
$DeliveryWeekSched=new delivery_scheduler();
$DeliveryWeekSched->getOrderShippingCost($cost_val,$cost_val);
delivery_scheduler.php
public function getOrderShippingCost($params, $shipping_cost)
{
if (Context::getContext()->customer->logged == true)
{
$id_address_delivery = Context::getContext()->cart->id_address_delivery;
$address = new Address($id_address_delivery);
return 100; // i want to return `$shipping_cost`
}
return $shipping_cost;
}
当车返回$shipping_cost
航运价值显示free
。当100
推车返回航运价值显示100
。那是什么?如何返回我的v ALUE?