Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Free Shipping option bug?


got2go

Recommended Posts

Hello All,

 

OSC 2.2 MS2, on Windows IIS 5, PHP 5.2.3

 

 

There seems to be a bug(?) in the free shipping calculation logic.

 

Ex: Free Shipping is turned on, for orders over $20

 

1- Person orders an item for $16.00. (does not qualify for free shipping)

2- On checkout, the person is shown all the shipping options and prices.

3- Person clicks on shipping option for $7.00.

4- Order total is now $23.00

5- On checkout, on the order review page, the person clicks on 'edit' for the shipping options.

6- Now the page only shows the free shipping option, person cannot change/choose any other shipping.

 

Result ?

Anybody that orders less than the minimum for free shipping can still trick the system and get free shipping.

 

Any ideas on how to fix this ?

(other than turning off free shipping)

 

Thanks!

Link to comment
Share on other sites

yes, it's a bug. I do not use it. I set up an extra flat rate shipping which I add conditions to (say to show only when total is over 100 USD) and set the fee to 0.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

yes, it's a bug. I do not use it. I set up an extra flat rate shipping which I add conditions to (say to show only when total is over 100 USD) and set the fee to 0.

 

HI Monika,

 

Thanks for the information :)

 

How would I add that flat rate with conditions ?

I see the flat rate in the shipping modules section, but it just allows me to turn it on.

Where would the conditions be added so it shows up if the orders are over $20 total ?

 

Thanks again for your help !!!

Link to comment
Share on other sites

the red part is new. I set 20 as a limiter

 

<?php
/*
 $Id: flat.php,v 1.40 2003/02/05 22:41:52 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 class flat {
   var $code, $title, $description, $icon, $enabled;

// class constructor
   function flat() {
     global $order;

     $this->code = 'flat';
     $this->title = MODULE_SHIPPING_FLAT_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_FLAT_SORT_ORDER;
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_FLAT_TAX_CLASS;
     $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);

     if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
       $check_flag = false;
       $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
       while ($check = tep_db_fetch_array($check_query)) {
         if ($check['zone_id'] < 1) {
           $check_flag = true;
           break;
         } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
           $check_flag = true;
           break;
         }
       }

       if ($check_flag == false) {
         $this->enabled = false;
       }
     }

[color="#FF0000"]			if (is_object($order)) {
// enable the module if the order total is over 20
			if ($this->enabled == true) {
				global $cart;
				if ($cart->show_total() < 20.00) {
					$this->enabled = false;
				}
			}
		}
   }[/color]

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Maybe this bugfix, by NILS, in 2003, is working for you:

http://forums.oscommerce.de/index.php?s=&a...ost&p=26033

 

change: catalog/checkout_shipping.php, approx. line 85

from:

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



 $free_shipping = true;

 

to:

   $free_shipping = false;

  if ( ($pass == true) && ($cart->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {

 $free_shipping = true;

"If you're working on something new, then you are necessarily an amateur."

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...