Jump to content

disable / hide free shipping methode


Rissinko

Recommended Posts

Hi i have one question.. 

 

I need to do this :

 

I have on e-shop free shipping method which is available only when customer want buy for more than 50€.

But its not very useful when he want buy lot of discounted products.

So i need to do this.... when is cart full of discounted products i need to hide this shipping method or somehow don't calculate this products to the amount which is used by this carrier method. 

 

 

I tried look at the shipping-cart.tpl and know i can calculate how much discounted products are in cart from all products in the cart. So i can create little {if} function which will be hidding that free shipping method but for this i need add custom css class to that free shipping carrier. 

 

Or second choice is edited calculation mathod of that amoun used by that freeshipping method.

 

 

Some advice ??

 

 

ok in getPackageShippingCost() from Cart.php I can change that order total ... maybe someone use it before ?

   } else {
        if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT) {
            $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight($product_list), $id_zone);
        } else { // by price
            $shipping_cost += $carrier->getDeliveryPriceByPrice($order_total, $id_zone, (int)$this->id_currency);
        }
    }
} else {
    if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT) {
        $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight($product_list), $id_zone);
    } else {
        $shipping_cost += $carrier->getDeliveryPriceByPrice($order_total, $id_zone, (int)$this->id_currency); // change amount here
    }
}
Edited by Rissinko (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...