Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

No shipping $ added to the total


csavern

Recommended Posts

Posted
Sorry for my english :

 

The problem is simple but the code is hard

 

If you have an amount in free shipping and a specific zone (example), the idea is to show only freeamount module and insert a message, "Free shipping" for example.

 

But if the freeamount condition is not respected, you see all others modules.

 

After, i don't think to have problem to continue the order because the shipping will be = 0 $ or the shipping will be a price.

 

That a first idea

 

The second idea is no change but when the free shipping is selected, the default module become free shipping. It's impossible to select in this moment the shipping module default when you have several shipping module.

Correct me if I am wrong but you want to see the free shipping as the only option when it applies and if the condition for free shipping are not met you want to show the others. Yes ?

That is what the default osC free shipping does (admin->modules->Order Total->Shipping)

Posted
Correct me if I am wrong but you want to see the free shipping as the only option when it applies and if the condition for free shipping are not met you want to show the others. Yes ?

That is what the default osC free shipping does (admin->modules->Order Total->Shipping)

 

I am not here but before in checkout_shipping. I think you must try the code, you will see the problem in checkout_shipping.

 

The problem with osc (and godd solution) is the shipping modules are independant. Or if you want display one module when you have several module in true is not simple. My code modify this condition (the function)for see only the free amount shipping in checkout_shipping if the condition is respected else you see all the modules shipping.

 

The pb is the customer localisazion by order to the freeamount condition (see the pb zone_id or geo_zone_id or country_id in database). because you can have for a freeamount only one country or several country in the zone defined.


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

  • 2 weeks later...
Posted

I found this solution

 

 

 

class shipping.php

 

//echo $class;

 

$include_modules[] = array('class' => $class, 'file' => $value);

 

}

 

}

 

// ################## Added MOdification freeamount #########################

 

global $total_weight, $order, $img;

 

$delivery_ok = 0;

 

$devilery = $order->delivery['country']['id'];

 

// #### Alternative ##############

 

if (( $devilery == '73') || ( $devilery == '75') || ( $devilery == '76') || ( $devilery == '77')) {

 

$delivery_ok = 1;

 

}

 

if (

 

($order->info['total'] >= MODULE_SHIPPING_FREEAMOUNT_AMOUNT) &&

 

(MODULE_SHIPPING_FREEAMOUNT_DISPLAY == 'True') &&

 

(MODULE_SHIPPING_FREEAMOUNT_STATUS == 'True') &&

 

(MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX > $total_weight) &&

 

($delivery_ok == '1')) {

 

 

 

if ($img == '1'){

 

echo '<img src='. DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . 'icons/shipping_free.gif><b> '. CART_SHIPPING_METHOD_FREE_TEXT .'<br></b>';

 

}

 

 

 

include(DIR_WS_LANGUAGES . $language . '/modules/shipping/freeamount.php');

 

include(DIR_WS_MODULES . 'shipping/freeamount.php');

 

$classfree = 'freeamount';

 

// $GLOBALS[$include_modules[$classfree]] = new $include_modules[$classfree];

 

} else {

 

// ################## End Added MOdification freeamount #########################

 

for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {

 

include(DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $include_modules[$i]['file']);

 

include(DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']);

 

$GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];

 

}

 

}

 

// ################## Added MOdification free shipping ########################

 

}

 

// ################## End added MOdification free shipping #########################

 

}

 

function quote($method = '', $module = '') {

 

global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;

 

 

In module shipping estimator :

 

// Only do when something is in the cart

 

if ($cart->count_contents() > 0) {

 

// ################## Added MOdification freeamount #########################

 

$img = 1;

 

// ################## End Added MOdification freeamount #########################

 

// Could be placed in english.php

 

// shopping cart quotes

 

 

 

 

In checkout_shipping.php

 

$total_weight = $cart->show_weight();

 

$total_count = $cart->count_contents();

 

 

 

// ################## Added MOdification freeamount #########################

 

$img = 0;

 

// ################## End Added MOdification freeamount #########################

 

// load all enabled shipping modules

 

require(DIR_WS_CLASSES . 'shipping.php');

 

$shipping_modules = new shipping;

 


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

  • 6 months later...
Posted

This same problem has happened to my site. The correct shippis is displayed on the checkout_shipping.php page but not on the checkout_confirmation.php page. I noticed this problem after getting an order in my admin with a total of $0.00 for a $5.00 item. The order had gone through pay-pal and I got my $5.00 but no shipping. Now all that shows up in the shipping method area is a "<" sign.

 

This is the call in my confirmation.php

<td class="main"><?php echo $order->info['payment_method']; ?></td>

 

and this is the result when i view the source of the page in notepad

<td class="main"><</td>

 

If any body has any idea please let me know.

 

my site is www.createadecal.com

Archived

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

×
×
  • Create New...