Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Free Shipping applied wrongly


vritzka

Recommended Posts

Hello,

 

firstly, thank you so much for this bootstrap version.

 

I have just completed re-building a store with it (PM for url) and it worked fantastic.

 

Glad I have it responsive now.

 

I found a bug and I'd like to post it here

 

 

Currently, customers can get free shipping for carts smaller than allowed. 

 

 

Lets say you allow free shipping from 50 EUR.  (in Admin -> Moduls -> order total -> shipping -> allow free shipping)

 

 

Your shipping cost for carts less than 50 EUR is 6 EUR

 

Now a customer has a cart worth 45 EUR.

 

 

The first time he goes to checkout_confirmation.php, he is shown shipping costs of 6 EUR, correct.

 

But now he/she decides to go back to the shopping cart and then starts checkout again.

 

 

Now he is show free shipping.

 

 

Here is why:

 

checkout_shipping.php around LINE 96

 

    if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {

      $free_shipping = true;
 
 
should be changed to 
 
   if ( ($pass == true) && (($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
      $free_shipping = true;
 
 
 
Because after choosing a shipping method during first time checkout, $order->info['total'] is being updated. The shipping cost is added.
 
Now $order->info['total'] equals 51 EUR. And with the current code, that will cause free shipping and the customer pays only 45 EUR.
 
 
 
This fix has additionally been done already in the shipping module, as we can see here: https://github.com/gburton/Responsive-osCommerce/blob/master/includes/modules/order_total/ot_shipping.php#L41
 
 
 
 
Thanks
Link to comment
Share on other sites

@@vritzka, thanks for the free shipping update.  I checked my 2.3.4BS live shop and yes free shipping occured incorrectly if customers go back to their shopping basket. Fixed worked.  Thanks again

Mike

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...