<?php


function shipping(Order $order){
	//si UK => table calcul
	// sinon => nous consulter
	if ($order->getCount()==0)
	{
		$ret=0;
	}
	elseif ($order->country=='GB')
	{
		$T1_limit=6.75; $T1_shipping=1.45;
		$T2_limit=18; $T2_shipping=2.55;
		$T3_limit=24; $T3_shipping=3.10;
		$T4_limit=48; $T4_shipping=4.50;
		$T5_limit=70; $T5_shipping=5.50;
		$T6_limit=100; $T6_shipping=7.75;
		$T7_limit=120; $T7_shipping=12.00;

		$ret=0;
		if ($order->getSubTotal() <= $T1_limit ) $ret=$T1_shipping;
		elseif ($order->getSubTotal() <= $T2_limit ) $ret=$T2_shipping;
		elseif ($order->getSubTotal() <= $T3_limit ) $ret=$T3_shipping;
		elseif ($order->getSubTotal() <= $T4_limit ) $ret=$T4_shipping;
		elseif ($order->getSubTotal() <= $T5_limit ) $ret=$T5_shipping;
		elseif ($order->getSubTotal() <= $T6_limit ) $ret=$T6_shipping;
		elseif ($order->getSubTotal() <= $T7_limit ) $ret=$T7_shipping;

	}
	else $ret=-1; // nous consulter

	return $ret;
}

?>