close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Free Shipping Coupon Codes with Multiple Shipping Rules

Thread began 8/17/2010 12:52 pm by jgraber | Last modified 8/24/2010 11:01 am by jgraber | 1382 views | 10 replies


Free Shipping Coupon Codes with Multiple Shipping Rules

I have successfully implemented a coupon code form on the cart page that compares the entered code with the database. I have created a simple discount rule in the cart for a family discount which works fine. My dilemma now is that I would like to have a code in the database for free shipping. I have 4 separate flat rate shipping rules so when the cart subtotal is above a certain number the shipping rate changes. My thought was that I could create a discount rule for free shipping by having the session variable conditions met and have the discount be equal to the shipping amount variable.

Here is my code:

//eCart Rule
function WAEC_iembroider_FreeShipping() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && (isset($_SESSION['CouponCode'])) && ((isset($_SESSION['CouponCode'])?$_SESSION['CouponCode']:"") == "freeship523"))) {
$totalDiscount += $totalShipping;//Result
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
//eCart Rule

This rule works properly when I have a flat rate discount or a percentage discount from the database, but I am unable to get the $totalShipping to work as the discount. Because there are multiple shipping rules I need the discount amount to change depending on the cart subtotal that is why I tried the $totalShipping.

Any thoughts would be appreciated. I know I could have four separate discount rules for free shipping, but that seems inefficient.

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





Ease of use


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