function getShippingCost($country, $shippingmethod, $weight, $eco, $reg, $eco_yw, $reg_yw, $epacket, $minipak, $minipak_fee, $eco_dhl,$eco_dhl_fee,$reg_dhl,$reg_dhl_fee, $discount) { var $ex_eu_minipak = 6/0.96; //TODO: fix value for now. change later. if ($shippingmethod == 1) { if ($weight <50) { return 50*$eco*$discount; } else { return $weight*$eco*$discount; } } else if ($shippingmethod == 2) { if ($weight <50) { return 50*$eco*$discount + 8; } else { return $weight*$reg*$discount+8; } } else if ($shippingmethod == 3) { if ($weight <50) { return 12.7; } else { return ($weight * $epacket +9)*$discount; } } else if ($shippingmethod == 4) { if ($weight <20) { return 2.7; } else if ($weight <50) { return 4.2; } else if ($weight <100) { return $weight*0.088; } else { return $weight*0.083; } } else if ($shippingmethod == 5) { return $weight * $eco_yw * $discount + 4; } else if ($shippingmethod == 6) { return $weight * $reg_yw * $discount +8; } else if ($shippingmethod == 7) { return (126.2 + Math.floor($weight/1000)*50.5)*$discount + 8; } else if ($shippingmethod == 8) { return (240 + Math.floor($weight/500)*75)*$discount + 8; } else if ($shippingmethod == 9) { return (210 + Math.floor($weight/500)*55)*$discount + 5; } else if ($shippingmethod == 10) { return (280 + Math.floor($weight/500)*75)*$discount + 5; } else if ($shippingmethod == 11) { return (90 + Math.floor($weight/1000)*30) * $discount + 8; } else if ($shippingmethod == 12) { return $weight*$minipak*$ex_eu_minipak+$minipak_fee*$ex_eu_minipak; } else if ($shippingmethod == 14) { return ((Math.floor($weight/50)*2)+ 70)*$discount; } else if ($shippingmethod == 15) { return (170.2 + Math.floor($weight/1000)*59.3)*$discount + 8; } else if ($shippingmethod == 16) { return ($weight * $eco_dhl + $eco_dhl_fee)*$discount; } else if ($shippingmethod == 17) { return ($weight * $reg_dhl + $reg_dhl_fee)*$discount; } else if ($shippingmethod == 18) { return (60 + Math.floor($weight/500)*30)*$discount + 8; } else if ($shippingmethod == 19) { return (33 + Math.floor($weight/100)*5); } else if ($shippingmethod == 20) { if($weight <50) { return 34; } else if ($weight <100) { return 36.1; } else if ($weight <100) { return 36.1; } else if ($weight <150) { return 38.1; } else if ($weight <200) { return 40.2; } else if ($weight <250) { return 42.2; } else if ($weight <300) { return 44.2; } else if ($weight <350) { return 46.3; } else if ($weight <400) { return 48.3; } else if ($weight <450) { return 50.4; } else if ($weight <500) { return 52.4; } else if ($weight <600) { return 56.5; } else if ($weight <700) { return 60.6; } else if ($weight <800) { return 64.6; } else if ($weight <900) { return 68.7; } else if ($weight <1000) { return 72.8; } else if ($weight <1100) { return 77.3; } else if ($weight <1200) { return 81.8; } else if ($weight <1300) { return 86.3; } else if ($weight <1400) { return 90.8; } else if ($weight <1500) { return 95.5; } else if ($weight <1600) { return 100; } else if ($weight <1700) { return 104.5; } else if ($weight <1800) { return 109; } else if ($weight <1900) { return 113.5; } else if ($weight <2000) { return 118; } else if ($weight <2100) { return 122; } else if ($weight <2200) { return 127; } else if ($weight <2300) { return 131; } else if ($weight <2400) { return 136; } else if ($weight <2500) { return 140.6; } else if ($weight <2600) { return 145.1; } else if ($weight <2700) { return 149; } else if ($weight <2800) { return 154.1; } else if ($weight <2900) { return 158; } else if ($weight <3000) { return 163.1; } else if ($weight <3100) { return 167; } else if ($weight <3200) { return 172.3; } else if ($weight <3300) { return 176.8; } else if ($weight <3400) { return 181.4; } else if ($weight <3500) { return 186; } else if ($weight <3600) { return 190.6; } else if ($weight <3700) { return 195.2; } else if ($weight <3800) { return 199.8; } } else if ($shippingmethod == 21) { if ($weight < 50) { return 13; } else if ($weight <200) { return $weight*0.08*$discount+9; } else { return $weight*0.075*$discount+9; } } else if ($shippingmethod == 22) { if ($weight < 50) { return 15; } else { return $weight*0.1*$discount+10; /* } else if ($shippingmethod == 23) { return $weight*$ali_stanardship*$discount+7; } else if ($shippingmethod == 24) { if ($weight < 30) { return 30*$ali_reg1*discount; */ } else { return $weight*ali_reg1*$discount; } else { return 0; } }