close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Discount on Quantity of Individual items

Thread began 5/17/2011 3:53 am by enquiry272230 | Last modified 5/20/2011 10:24 am by enquiry272230 | 1628 views | 10 replies

enquiry272230

Thanks Jason, but that's the same for this application as using the ID method as far as I can see.

There are four batches of 60 drills, each batch with different characteristics, and so I'm back to the same situation, 240 drills and each batch of 60 with 8 quantity discount formulas.

At present the wizard works using a drill's ID, as that separates each item in the cart for it's own discount calculation.

Here is the current code from the wizard for 2 rules I have set up:

//Discounts
$this->Discounts[] = new WA_eCart_Rule(urldecode("SterileShortAOConnect"), true, "WAEC_CingleCart_SterileShortAOConnect");
$this->Discounts[] = new WA_eCart_Rule(urldecode("SterileLongAOConnect"), true, "WAEC_CingleCart_SterileLongAOConnect");
//Charges
//Tax
$this->Tax[] = new WA_eCart_Rule(urldecode("GST"), true, "WAEC_CingleCart_GST");
//Shipping
}
//end node
//start node
//eCart Rule
function WAEC_CingleCart_SterileShortAOConnect() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && ($this->ConditionalTotal("Quantity", "ID", "20") >= 100) && ($this->ConditionalTotal("Quantity", "ID", "20") < 499) && ($this->ConditionalTotal("Quantity", "PriceCategory", "1") > 0))) {
$totalDiscount += ($this->ConditionalTotal("Quantity", "ID", "20") * 2.5);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_CingleCart_SterileLongAOConnect() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && ($this->ConditionalTotal("Quantity", "ID", "26") >= 100) && ($this->ConditionalTotal("Quantity", "ID", "26") < 499) && ($this->ConditionalTotal("Quantity", "PriceCategory", "2") > 0))) {
$totalDiscount += ($this->ConditionalTotal("Quantity", "ID", "26") * 3.30);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

If I could get the code to automatically source the ID of a drill bit from the item in the cart, (ID's are 20 & 26 in the above code) it would work OK.
Is this possible ??

Or is there a better method that I am not seeing?

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