Jump to content

Excluding additional item cost only for My carrier (shipping option)


Recommended Posts

Hello everybody,

 

for completing my shipping system i need to have the followibng option - To exclude the additional cost of an item, when the shipping is chosen to be with My carrier - which should be totally free for some zones, which zones i have already adjusted. I mean only the additional cost for an item, because there is a price range for this carier, where is set that an order with value less than some amount will be charged with small shipping tax. This additional cost for item i will use for every other carrier, but i want to exclude it for each item in the order, when the order will be shipped by My carrier - which is free of charge and it is subject only to one minimum price range.

Can somebody help me adjust this, or inform me if it is possible with the backoffice of Presta 1.5.4.1.

Or if i have to rewrite some of the php files - please inform me which class or file should i change for giving me this result.

 

Thanks in advance.

 

P.S. - I have made some correction of the explanation, as now it is more clear what exactly i would like to adjust. Because as far as i can see, i can not exclude only the additional cost separately, but al the shipping cost for one carrier.

Edited by pl.sabotinov (see edit history)
Link to comment
Share on other sites

Any idea?

Is it too easy or in the opposite it can not be done without change in the correct file?

Because i see that there is an option to disable all the shipping costs for a carrier, to disable the shipping and handling costs according to the ranges, but there is no option to disable only the additional shipping cost of an item for selected carrier. If someone knows, please advise me which file should i consider and change for disabling this additional shipping cost of an item(product), when specific carier is selected.

Link to comment
Share on other sites

Hello again,

 

i have solved it partially. In classes directory -> Cart.php , there is a function that computes the additional shipping cost. HAve read an issue about similair problem here in the forum. 

So here the function:

 

// Additional Shipping Cost per product  - row 2724
        foreach ($products as $product)
            if (!$product['is_virtual'] && $shipping_cost > 0)
                $shipping_cost += $product['additional_shipping_cost'] * $product['cart_quantity'];

 

So the solution is made for another problem, but in my case it has also same result. If the delivery is with My carrier, which is free, and shipping cost is 0, the second condition (&& $shipping_cost > 0) in the if clause, does prevent from adding the additional shipping cost of the product. 

But the better idea is to have condition that makes refference to selected carrier which give us much more options. I  will try to find answers in a new topic. How to involve in this function new condition for carriers, which adds or not this additional costs dfepending on carrier.

Link to comment
Share on other sites

Hello once again,

the problem is solved, but why nobody else hasn't replied?

 

The solution is in the file Cart.php - row 2724

as i have mentioned in my last post we have to chnage the code there. But i haven't seen that the variable $id_carrier  is global (public) so we can access it's value from this part of the code, where the variable already has to be "loaded" with the id of the chosen carrier. So just adding the following code:

 

  foreach ($products as $product)

  if (!$product['is_virtual'] && $id_carrier > X{id of selected carrier})
                $shipping_cost += $product['additional_shipping_cost'] * $product['cart_quantity'];

 

you can reach the logic i have mentioned: to avoid only the additional shipping cost for selected carriers.

Here we can also put a special condition for selected carrier:

 

if (!$product['is_virtual'] && $id_carrier > X{id of selected carrier})

            If ($id_carrier ....)
                $shipping_cost += $product['additional_shipping_cost'] * $product['cart_quantity'] * X;

            else 

                 $shipping_cost += $product['additional_shipping_cost'] * $product['cart_quantity'] ;

 

 

I hope next time the other members will answer me  before i loose a lot of time to find the file / code i need to change. I am newbie with prestashop, therefore the beginning is a bit difficult.

 

Link to comment
Share on other sites

  • 9 years later...

I have same problem...

I want to add new carrier with flat rate shipping for Madrid, were customers can choose normal shipping which is for all Spain including Madrid or just the spacial price I have for Madrid.. I create that new carrier but each product has different additional shipping costs and this rise the shipping !!

I use prestashop 8.. any idea how do disable "additional shipping costs" just for the new carrier?? 

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