Modifying Shipping Charge Based Session Varible
I need to change the shipping charge based on a UK postcode. There will only be two rates of charge "normal" and then a higher charge.
I have built the logic for checking the postcode and determining which one should incur the higher change. I am then setting a session variable for these postcodes. If the session variable exists then the higher charge should be made.
For a number of reasons (happy to discuss in a private message) I want to the above by having an extra if statement in the eCart object. I am using the PHP below but this always gives the lower charge.
The session variable is called $_SESSION["remote"]. I have tried to ensure that the session variable exists before calling a page that displays the cart and allows the customer to confirm the transaction.
Can you see what might be going wrong ? Many thanks !
<?php
//eCart Rule DJE modified for remote postcodes using session variable
function WAEC_ShippingCharge() {
$totalCharge = 0;
if (((sizeof($this->Items) >= 1)) && ((isset($_SESSION['$_SESSION[\"remote\"]'])))) {
$totalCharge += 15.00;//Result
}
else {
$totalCharge += 7.50;//Result
}
return WA_eCart_FormatNumber($totalCharge, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
?>