close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

discount code to only apply to items with weight of 1

Thread began 1/10/2010 3:38 pm by sam308940 | Last modified 1/12/2010 1:36 pm by Jason Byrnes | 1034 views | 3 replies |

sam308940

discount code to only apply to items with weight of 1

I want to add a discount rule that only gives discounts to items that have a weight of 1
below is my current rule. I tried a few combinations of adding $this->Weight and $this->itemWeight ..... but it still just gave all items the discount. what I want is to only apply the discount to items with weight = 1, not just require that any item in the cart has a weight of 1.

//eCart Rule
function WAEC_pcccart_10NEW() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['discount_code'])?$_SESSION['discount_code']:"") == "10NEW") || ((isset($_SESSION['discount_code'])?$_SESSION['discount_code']:"") == "10New") || ((isset($_SESSION['discount_code'])?$_SESSION['discount_code']:"") == "10new"))) {
$totalDiscount += ($this->TotalColumn("TotalPrice") * .10);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

Sign in to reply to this post

Jason ByrnesWebAssist

dont add this in the code, add it when creating the rule.


In the Calculation section, select "Based on Items With a specific Value":
Total of "TotalPrice" Where "Weight" has a value of "1" "times" "0.1"

Sign in to reply to this post

sam308940

OHH but we want to base it on a coupon code being entered.
so that the coupon applies to any items that have weight=1.

am I missing something?
if I do it your way, wont it give discounts to item with weight of 1 without a coupon code?

Sign in to reply to this post

Jason ByrnesWebAssist

No, the trigger stays the same, In the calculation section, enter the calculation that I mentioned before.

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