close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

single item discount by coupon code

Thread began 5/19/2011 5:59 am by sam308940 | Last modified 5/20/2011 1:35 pm by Jason Byrnes | 1723 views | 5 replies |

sam308940

single item discount by coupon code

my client wants to give a particular item a discount, but based on coupon code. how can i do a single item discount like this? i just need to be pointed in the right direction...........

i have done a gazillion codes that give free shipping, % off, flat rate off etc. but nothing ever for a single item.

Sign in to reply to this post

Jason ByrnesWebAssist

you will need to know the ID of the item to apply the discount code to.
In addition to the Based on session value trigger that is used for coupon codes, add another trigger:
Presence of an Item In the cart:
If item "<item ID>" "exists" in the cart.


the add you flat rate discount.

Sign in to reply to this post

sam308940

Hi - wow you are fast today!

i did kind of figure things out. but i have an issue with it.

lets say someone adds the item we want on sale, in a size 6 and a size 10. it shows up as 2 items separately in the cart.

when it calculates the discount total, it only calculates for 1 of them, not both. so - i need to add qty to the calculation. how do i grab the total quantity of that item in the cart. (not the qty of total items in cart)

Here is my code so far.....
//eCart Rule
function WAEC_JULES_LUCKY6() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && ($this->InCart("SS2411") == true)) && (((isset($_SESSION['discount_code'])?$_SESSION['discount_code']:"") == "LUCKY6") OR ((isset($_SESSION['discount_code'])?$_SESSION['discount_code']:"") == "lucky6"))) {
$totalDiscount += (floatval($this->GetInfo("SS2411", "TotalPrice")) * .3);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

Sign in to reply to this post

Jason ByrnesWebAssist

Instead of using "Items column value" in the calculation section, use "Based on items with a specific value":
Total Of "TotalPrice" where "ID" has a value of "SS2411" "Times" "0.3"

Sign in to reply to this post

sam308940

ok that solved it. thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

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