Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Oscommerce Else if statement problem


hussein_787

Recommended Posts

Hi

 

I am trying to work with the tiered shipping module but having a problem with adding extra if statements, I try the code below but its bringing back a blank page on checkout_shipping.php

 

Please see code below

 

function quote($method = '') {
	global $order, $cart;

	if (MODULE_SHIPPING_INTERNATIONALTIERED_STATUS == 'True') {
		$order_total = $cart->show_total();
	}
	if ($order_total < MODULE_SHIPPING_INTERNATIONALTIERED_LEVEL_2) {
		$shipping_internationaltiered = MODULE_SHIPPING_INTERNATIONALTIERED_RATE_1;
	}
	else {
		if ($order_total < MODULE_SHIPPING_INTERNATIONALTIERED_LEVEL_3) {
			$shipping_internationaltiered = MODULE_SHIPPING_INTERNATIONALTIERED_RATE_2; }
	}
	else {
		if ($order_total < MODULE_SHIPPING_INTERNATIONALTIERED_LEVEL_4) {
			$shipping_internationaltiered = MODULE_SHIPPING_INTERNATIONALTIERED_RATE_3; }
	}
	else {
		if ($order_total < MODULE_SHIPPING_INTERNATIONALTIERED_LEVEL_5) {
			$shipping_internationaltiered = MODULE_SHIPPING_INTERNATIONALTIERED_RATE_4; }
	}
	else {
		if ($order_total < MODULE_SHIPPING_INTERNATIONALTIERED_LEVEL_6) {
			$shipping_internationaltiered = MODULE_SHIPPING_INTERNATIONALTIERED_RATE_5; }
	}
	else {
		if ($order_total < MODULE_SHIPPING_INTERNATIONALTIERED_LEVEL_7) {
			$shipping_internationaltiered = MODULE_SHIPPING_INTERNATIONALTIERED_RATE_6; }
	}

	else {
		$shipping_internationaltiered = MODULE_SHIPPING_INTERNATIONALTIERED_RATE_7;
	}

 

Do you know what I might be doing wrong

 

Thank you

Unique skins and accessories for your media player device - iPod / iPhone / PSP / Nintendo / Xbox - www.iangel.co.uk

Link to comment
Share on other sites

it should be: } else if {

ie:

 

if ($order_total < MODULE_SHIPPING_INTERNATIONALTIERED_LEVEL_2) {
                       $shipping_internationaltiered = MODULE_SHIPPING_INTERNATIONALTIERED_RATE_1;
               }
               else if ($order_total < MODULE_SHIPPING_INTERNATIONALTIERED_LEVEL_3) {
                       $shipping_internationaltiered = MODULE_SHIPPING_INTERNATIONALTIERED_RATE_2; 
}else if (..condiction..) {
//do something
} ... and so on...

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...