Jump to content

Shipping Cost formula and Free Shipping


vgrassb

Recommended Posts

Hello everyone, Im working on Prestashop 1.6.1.17

Im tying to find a new formula for shipping cost because in my country its kinda expensive.

The first thing Ive changed was the code "product handling price" so instead of adding it will substract from the shipping price.

So if you get more products they will substract a different amount (depending on the margin of the product) from the total shipping cost.

So in /classes/Cart.php ive changed + into -

// Additional Shipping Cost per product
        foreach ($products as $product) {
            if (!$product['is_virtual']) {
                $shipping_cost -= $product['additional_shipping_cost'] * $product['cart_quantity'];

The problem is I need to set a minimum shipping fee for all orders. If they add certain amount the shipping cost will go to 0 and say free shipping,  this amount sometimes wont be over the minimum price of shipping so I will lost money. I dont know how to add a minimum shipping fee in the formula so if the shipping cost goes equal or less than 0 they pay $X money.

 

Thanks for any comment or help, best regards.

Link to comment
Share on other sites

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...