Jump to content

Edit History

Mediacom87

Mediacom87

<?php
class Cart extends CartCore
{
    /*
    * module: freedeliverymanager
    * date: 2021-10-28 12:18:28
    * version: 1.6.21
    */
    public function getPackageShippingCost(
        $id_carrier = null,
        $use_tax = true,
        Country $default_country = null,
        $product_list = null,
        $id_zone = null,
        bool $keepOrderPrices = false
    ) {
        $freedeliverymanager = Module::getInstanceByName('freedeliverymanager');
        if (!$freedeliverymanager || !$freedeliverymanager->active) {
            return parent::getPackageShippingCost(
                $id_carrier,
                $use_tax,
                $default_country,
                $product_list,
                $id_zone,
                $keepOrderPrices
            );
        } else {
            $free_shipping_price = $freedeliverymanager->getFreeShippingPrice(
                $this,
                $id_carrier,
                $use_tax,
                $default_country,
                $product_list,
                $id_zone
            );
            if ($free_shipping_price < 0) {
                return parent::getPackageShippingCost(
                    $id_carrier,
                    $use_tax,
                    $default_country,
                    $product_list,
                    $id_zone,
                    $keepOrderPrices
                );
            }
            return $free_shipping_price;
        }
    }
    
    

 

Mediacom87

Mediacom87

<?php
class Cart extends CartCore
{
    /*
    * module: freedeliverymanager
    * date: 2021-10-28 12:18:28
    * version: 1.6.21
    */
    public function getPackageShippingCost(
        $id_carrier = null,
        $use_tax = true,
        Country $default_country = null,
        $product_list = null,
        $id_zone = null,
        bool $keepOrderPrices = false
    ) {
        $freedeliverymanager = Module::getInstanceByName('freedeliverymanager');
        if (!$freedeliverymanager || !$freedeliverymanager->active) {
            return parent::getPackageShippingCost(
                $id_carrier,
                $use_tax,
                $default_country,
                $product_list,
                $id_zone,
                $keepOrderPrices
            );
        } else {
            $free_shipping_price = $freedeliverymanager->getFreeShippingPrice(
                $this,
                $id_carrier,
                $use_tax,
                $default_country,
                $product_list,
                $id_zone,
                $keepOrderPrices
            );
            if ($free_shipping_price < 0) {
                return parent::getPackageShippingCost(
                    $id_carrier,
                    $use_tax,
                    $default_country,
                    $product_list,
                    $id_zone,
                    $keepOrderPrices
                );
            }
            return $free_shipping_price;
        }
    }
    
    

cela devrait focntionner

×
×
  • Create New...