close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Modifying Shipping Charge Based Session Varible

Thread began 6/25/2015 3:35 am by djellis267466 | Last modified 6/25/2015 2:18 pm by djellis267466 | 173 views | 1 replies

djellis267466

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
?>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...