close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Only allow one discount code to be used

Thread began 5/03/2022 4:18 am by Mags | Last modified 5/03/2022 11:46 am by Ray Borduin | 207 views | 4 replies |

Mags

Only allow one discount code to be used

Hi Ray, I know I'm probably missing something really simple, but how would I prevent users applying multiple discount codes? I have an automatic 30% discount code on a site which kicks in if the user orders 10 or more books, however my client wants to offer a 50% discount on one book. I don't want users to be able to apply this discount in addition to the 30% discount.

I tried this but it doesn't stop users adding the additional code:

//eCart Rule
function WAEC_Cart_BOOK50OFF() {
$totalDiscount = 0;
if (true && (($this->InCart("6") == true) && ((isset($_SESSION['PromoCode'])?$_SESSION['PromoCode']:"") == "BOOK50") && (!isset($_SESSION['BIGBUNDLE30'])))) {
$totalDiscount += floatVal("6.50");//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

Sign in to reply to this post

Ray BorduinWebAssist

Also add a condition that there are less than 10 items in the cart in the rule so that the 50% off rule wouldn't apply at the same time as the 30% off.

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

Mags

Thanks, that works! Out of interest, is there a way of adding a global rule that would mean you can't use more than one discount code at a time?

Sign in to reply to this post

Ray BorduinWebAssist

No there isn't. I could probably help with something like that in a premier support ticket if you need it.

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

Mags

Probably not necessary just now but I'll bear it in mind!

Sign in to reply to this post

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