【问题标题】:Max shipping cost prestashop 1.7最大运费 prestashop 1.7
【发布时间】:2018-12-19 07:19:19
【问题描述】:

如何在 PrestaShop 1.7 中设置每 199 件的最大发货量 它可能会更小,但可能不会超过 199 出货量对应的变量在哪个文件中查找?

【问题讨论】:

    标签: max prestashop shipping


    【解决方案1】:

    Cart类覆盖函数getPackageShippingCost()

    class Cart extends CartCore 
    {
        public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null)
        {
            $shipping_cost = parent::getPackageShippingCost($id_carrier, $use_tax, $default_country, $product_list, $id_zone);
    
            if ($shipping_cost > 199) {
                return 199;
            }
        }
    }
    

    记得删除class_index.php并清除缓存。

    【讨论】:

    • 谢谢!一切正常,只有这行: $shipping_cost = parent::getPackageShippingCost($id_carrier, $use_tax, $default_country, $product_list, $id_zone);收取承运人的运费 在商店中,承运人的价格已设置为 0,而每个产品的额外运费决定了运费。
    • 那么如何从产品卡中获取实际运费以及“额外费用”:-)
    • 已经添加到父级的getPackageShippingCost函数:// Additional Shipping Cost per product foreach ($products as $product) { if (!$product['is_virtual']) { $shipping_cost += $product['additional_shipping_cost'] * $product['cart_quantity']; } }
    猜你喜欢
    • 2021-01-07
    • 1970-01-01
    • 2017-11-10
    • 2021-06-14
    • 1970-01-01
    • 2012-04-19
    • 2018-06-01
    • 2018-05-15
    • 1970-01-01
    相关资源
    最近更新 更多