Jump to content

SOLVED - Shipping costs after discount voucher


Recommended Posts

Hi all,

I have a question and I already searched the forum, but could not find a topic about this.
Perhaps is very easy, but in that case I'm not seeing it :long:

If a customers buys for more than 50 euros, they do not have to pay shipping costs.
All works fine, but my issue is with the following situation:
Customer buys for 55 euro's and uses a 10 euro discount voucher. The adjusted amount of the basket is 45 euro's.
However, PrestaShop still looks at the true value of the products and doesn't calculate shipping costs. So, basket is less then 50 euro's and no shipping costs.

What do I need to do, to make sure shipping costs are added to the order when the total amount is less then 50 euro's, even when a discount voucher is used?

I hope someone can direct me in the right way.

(Using PS 1.2.5 by the way.)

Many thanks in advance!

Link to comment
Share on other sites

well I do not know what you do wrong but with me it works fine.
on my shop if they buy more than 140euro the shipment is free.

so I start shopping untill I have 145 euro.
so the shipment is free.
then I just add a voucher code with -10% so the total amount to pay is : 145-14.5euro = 130.5
and yes..there is the shipment cost again.

look at my screenshot.

32481_PjnSkCQtytfDX7iH7h8T_t

Link to comment
Share on other sites

Hi deech123,

I don't use weights, so all products are 0kg and I only use 1 carrier.
Attached screenshot of my settings. (By the way: url of shop is www.beautyskin.nl)

I started to think the error is not in the shipping settings, but perhaps in the shopping cart.
If you take a look at the second screenshot, in the bottom you see the message that customer needs to order some more for free shipping. But shopping cart already does not calculate shipping costs.

I'm pretty confused..... :-S

32631_wVCJCDUU747qtyQsAiE5_t

32632_Q155lsvOaB1dHxblBhv1_t

Link to comment
Share on other sites

okey first thing,

do not enter a shipping fee in the field handling charges. that's the first mistake since you have 2 carriers : Benelux and Nederland.
so you can do 1 thing,
change 6.95 to 0
remove zone Nederland because this is also in benelux.
if not make 2 new zones :
Belgium-Luxemburg
Nederland

I see you added a price range.
so then what you do is :
click on the shipping tab.
on the back enter for carrier TNT the 6.95 shipping cost.
and retry.

there is a error in the way of working.

Link to comment
Share on other sites

I changed the settings like you said.
Now I know for sure it's not shipping where the issue is. It's the shopping cart.
When I follow your instructions, no shipping costs at all our calculated. Also not when I place < 50 euro in the shopping cart.

I will try to re-install the blockcart module.

Link to comment
Share on other sites

Rob,

I really think it is not the blockcart....
it must be a configuration setting.
what you can try to do is this.

instead of 2 preice ranges, make 2 weight ranges (Like I did)
from 0 to 85000 gram (more than enough :-) )

and then calculate price by weight.
enter for the two zones the shipcost and in the 3 fields on top just enter the free shipment starting from 50euro in your case.
and test it again.

be sure every country is linked to a zone
and every tax is also linked to the zone.

Link to comment
Share on other sites

  • 3 weeks later...

I encountered this issue as well, I solved it by changing this line in order.php:

$total_free_ship =  $free_ship - ($summary['total_products_wt'] + $summary['total_discounts']);


to

$total_free_ship =  $free_ship - $summary['total_products_wt'] + $summary['total_discounts'];


I just removed the (). Since the $summary['total_discounts'] has got a negative value and there is a minus sign in front of the () it gets messed up.

Link to comment
Share on other sites

Rob,

I really think it is not the blockcart....
it must be a configuration setting.
what you can try to do is this.

instead of 2 preice ranges, make 2 weight ranges (Like I did)
from 0 to 85000 gram (more than enough :-) )

and then calculate price by weight.
enter for the two zones the shipcost and in the 3 fields on top just enter the free shipment starting from 50euro in your case.
and test it again.

be sure every country is linked to a zone
and every tax is also linked to the zone.


I have the same problem but I don't resolve it.
Link to comment
Share on other sites

Rob,

I really think it is not the blockcart....
it must be a configuration setting.
what you can try to do is this.

instead of 2 preice ranges, make 2 weight ranges (Like I did)
from 0 to 85000 gram (more than enough :-) )

and then calculate price by weight.
enter for the two zones the shipcost and in the 3 fields on top just enter the free shipment starting from 50euro in your case.
and test it again.

be sure every country is linked to a zone
and every tax is also linked to the zone.


I have the same problem but I don't resolve it.

Did you try my solution?
I encountered this issue as well, I solved it by changing this line in order.php:
$total_free_ship =  $free_ship - ($summary['total_products_wt'] + $summary['total_discounts']);


to

$total_free_ship =  $free_ship - $summary['total_products_wt'] + $summary['total_discounts'];


I just removed the (). Since the $summary['total_discounts'] has got a negative value and there is a minus sign in front of the () it gets messed up.

Link to comment
Share on other sites

I encountered this issue as well, I solved it by changing this line in order.php:
$total_free_ship =  $free_ship - ($summary['total_products_wt'] + $summary['total_discounts']);


to

$total_free_ship =  $free_ship - $summary['total_products_wt'] + $summary['total_discounts'];


I just removed the (). Since the $summary['total_discounts'] has got a negative value and there is a minus sign in front of the () it gets messed up.



Thanks for the tip, but it didn't solve the issue for me.
Link to comment
Share on other sites

I solved the issue.

Problem is classes/Cart.php
Search for //Free fees

current code:

// Free fees
if (isset($configuration['PS_SHIPPING_FREE_PRICE']) AND $orderTotal >= floatval($configuration['PS_SHIPPING_FREE_PRICE']) AND floatval($configuration['PS_SHIPPING_FREE_PRICE']) > 0)    return $shipping_cost;if (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) AND $this->getTotalWeight() >= floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) AND floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0)    return $shipping_cost;



I changed this section with the //Free fees section from PS 1.3.1 Cart.php:

// Free fees
$free_fees_price = 0;if (isset($configuration['PS_SHIPPING_FREE_PRICE']))    $free_fees_price = Tools::convertPrice(floatval($configuration['PS_SHIPPING_FREE_PRICE']), new Currency(intval($this->id_currency)));$orderTotalwithDiscounts = $this->getOrderTotal(true, 4);if ($orderTotalwithDiscounts >= floatval($free_fees_price) AND floatval($free_fees_price) > 0)    return $shipping_cost;if (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) AND $this->getTotalWeight() >= floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) AND floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0)    return $shipping_cost;



This did the trick for me.

Link to comment
Share on other sites

  • 5 months later...
I solved the issue.

Problem is classes/Cart.php
Search for //Free fees

current code:
// Free fees
if (isset($configuration['PS_SHIPPING_FREE_PRICE']) AND $orderTotal >= floatval($configuration['PS_SHIPPING_FREE_PRICE']) AND floatval($configuration['PS_SHIPPING_FREE_PRICE']) > 0)    return $shipping_cost;if (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) AND $this->getTotalWeight() >= floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) AND floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0)    return $shipping_cost;



I changed this section with the //Free fees section from PS 1.3.1 Cart.php:

// Free fees
$free_fees_price = 0;if (isset($configuration['PS_SHIPPING_FREE_PRICE']))    $free_fees_price = Tools::convertPrice(floatval($configuration['PS_SHIPPING_FREE_PRICE']), new Currency(intval($this->id_currency)));$orderTotalwithDiscounts = $this->getOrderTotal(true, 4);if ($orderTotalwithDiscounts >= floatval($free_fees_price) AND floatval($free_fees_price) > 0)    return $shipping_cost;if (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) AND $this->getTotalWeight() >= floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) AND floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0)    return $shipping_cost;



This did the trick for me.



Has anyone tried this or any other solution for this issue in PS 1.4? I also have same issue: I want a free shipping if customer spends for 100€ or more (with vouchers calculated, if any). Now I if they purchase for 100€ and they use 10% voucher total price becomes 90€ (free shipping still apply, which is not good), total should be 90€+shipping ... I don't use general 'Free shipping starts at: 100€' but I have 2 different zones with different free shipping price ranges, so I have choice of range selected as 'According to total price'. Thank you for any help!
Link to comment
Share on other sites

  • 4 months later...

 

Has anyone tried this or any other solution for this issue in PS 1.4? I also have same issue: I want a free shipping if customer spends for 100€ or more (with vouchers calculated, if any). Now I if they purchase for 100€ and they use 10% voucher total price becomes 90€ (free shipping still apply, which is not good), total should be 90€+shipping ... I don't use general 'Free shipping starts at: 100€' but I have 2 different zones with different free shipping price ranges, so I have choice of range selected as 'According to total price'. Thank you for any help!

i have the same problem using the PS 1.4

Please anyone advice.

Link to comment
Share on other sites

  • 4 months later...

This did not work for me. I'm using PS 1.3.1. I don't use weight to calculate the shipping cost. Could anyone help please?

 

I solved the issue.

Problem is classes/Cart.php

Search for //Free fees

current code:

// Free fees
if (isset($configuration['PS_SHIPPING_FREE_PRICE']) AND $orderTotal >= floatval($configuration['PS_SHIPPING_FREE_PRICE']) AND floatval($configuration['PS_SHIPPING_FREE_PRICE']) > 0)	return $shipping_cost;if (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) AND $this->getTotalWeight() >= floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) AND floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0)	return $shipping_cost;

I changed this section with the //Free fees section from PS 1.3.1 Cart.php:

// Free fees
$free_fees_price = 0;if (isset($configuration['PS_SHIPPING_FREE_PRICE']))	$free_fees_price = Tools::convertPrice(floatval($configuration['PS_SHIPPING_FREE_PRICE']), new Currency(intval($this->id_currency)));$orderTotalwithDiscounts = $this->getOrderTotal(true, 4);if ($orderTotalwithDiscounts >= floatval($free_fees_price) AND floatval($free_fees_price) > 0)	return $shipping_cost;if (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) AND $this->getTotalWeight() >= floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) AND floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0)	return $shipping_cost;

This did the trick for me.

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 4 months later...
  • 5 months later...
  • 2 years later...
  • 2 weeks later...
  • 3 years later...
  • 2 weeks later...
  • 3 years later...
On 8/17/2018 at 7:40 AM, rpaxtian said:

help me please,  any solution for my PS 1.7.4.2? Thanks.

Possible solution here as well:
https://www.knowband.com/blog/tutorials/calculate-free-shipping-based-final-total-price-prestashop/

Have just tested this and it doesn't seem to work.
However it's close, probably just some difference in newer versions

Edited by GoPure Kratom
Correction and new info (see edit history)
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...