close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Modifying Shipping Charge Based Session Varible

Thread began 6/25/2015 12:35 am by djellis267466 | Last modified 6/25/2015 11:18 am by Ray Borduin | 415 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
?>

Sign in to reply to this post

Ray BorduinWebAssist

It looks like in the field where it asked for the session variable name it you put: $_SESSION["remote"]
but it was expecting just the variable name: remote

That caused the code to be wrong and it wrote:
if (((sizeof($this->Items) >= 1)) && ((isset($_SESSION['$_SESSION[\"remote\"]'])))) {

it should just be:
if (((sizeof($this->Items) >= 1)) && ((isset($_SESSION['remote'])))) {

Sign in to reply to this post
Did this help? Tips are appreciated...

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