根据 magento 中的产品重量更改最终运费
Change final shipping rate based on the product weight in magento
我正在使用 table rate
进行运输方式配置。
但最终运费会根据产品重量发生变化。
最终运费=运费*产品重量
例如:如果产品重量=6kg,最终运费将为6*100
如果产品重量=11kg,最终运费为11*90。
我怎样才能实现这个功能?
请修改此文件
app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php
从
更改第 166 行
$shippingPrice = $this->getFinalPriceWithHandlingFee($rate['price']);
到
$shippingPrice = ($rate['price']*$request->getPackageWeight());
我正在使用 table rate
进行运输方式配置。
但最终运费会根据产品重量发生变化。
最终运费=运费*产品重量
例如:如果产品重量=6kg,最终运费将为6*100 如果产品重量=11kg,最终运费为11*90。
我怎样才能实现这个功能?
请修改此文件
app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php
从
更改第 166 行$shippingPrice = $this->getFinalPriceWithHandlingFee($rate['price']);
到
$shippingPrice = ($rate['price']*$request->getPackageWeight());