我正在开发Oxid 自定义模块。我想在飞行中改变运输方式的价格。是否有任何方法可以获得任何钩子或方法,也可以获得中断发送方法的选择?对于运行服务器端php代码,我还了解到需要扩展OXID的函数,例如,对于要跟踪的页面,使用呈现()函数。对于产品页面,它将是“详细信息”->应用程序/控制器/详细信息。the类别页是"alist.php“,篮子是basket.php。
发布于 2016-12-05 13:07:47
oxBasket->_calcDeliveryCost()似乎是您要寻找的函数,它根据配置的传递集计算交付成本。ce/blob/b-5.3-ce/source/application/models/oxbasket.php#L903-L948
此函数由calculateBasket()在这里调用:ce/blob/b-5.3-ce/source/application/models/oxbasket.php#L1487,当您更改传送方法时,也会调用该函数
发布于 2016-12-05 13:14:30
你需要一个牛篮的模块。元数据:
'extend' => array(
'oxbasket' => 'youmodule/application/models/oxbasket_delivery'
)在单元中:
class oxbasket_delivery extends oxbasket_delivery_parent
{
public function calculateBasket($blForceUpdate = false)
{
parent::calculateBasket($blForceUpdate);
/** @var oxPrice $deliveryCost */
$dnewDeliveryPrice = 10; // or whatever you need
$deliveryCost = oxNew('oxprice');
$deliveryCost->setPrice($dnewDeliveryPrice);
$this->setCost('oxdelivery', $deliveryCost);
}
}https://stackoverflow.com/questions/40974586
复制相似问题