# Quantity Discount Help

Thread began 7/19/2012 4:29 pm by psychobilly1165508 | Last modified 7/23/2012 10:35 pm by psychobilly1165508 | 185 views | 2 replies |

## 7/19/2012 4:29 pm  |  #1 psychobilly1165508

### Quantity Discount Help

I have a quantity discount column in my database to group various products for certain discounts.

Number of Items where "qtydiscount" has value of "1" is equal to a value of "2"
Calculation = Flat Rate = \$9.98

What I have, works perfect. But I need to multiply the discount based on multiples of 2.
Example:
if 4 items were in the cart, it would deduct \$19.96
if 6 items were in the cart, it would deduct \$29.94
and so on...

I can't seem to figure out the logic on this. Thanks

code:

//eCart Rule
function WAEC_ssdcart_QuantityDiscount() {
\$totalDiscount = 0;
if (true && ((\$this->ConditionalTotal("Quantity", "qtydiscount", "1") == 2))) {
\$totalDiscount += 9.98;//Result
}
return WA_eCart_FormatNumber(\$totalDiscount, \$this->ForceDecimalsC, \$this->DecimalPlacesC);
}
//eCart Rule

## 7/20/2012 11:28 am  |  #2 Jason Byrnes

set the trigger to number of items where qtydiscount = 1 is >= 2

then use this code in the flat rate calculation:

php:
`9.98 * ceil((\$this->ConditionalTotal("Quantity", "qtydiscount", "1") - 1) / 2)`

ok, thanks

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

## Everything else!

Close Window

Account or customer service questions?

Need technical support?

Content

Layout

Ease of use

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 Window

# We were unable to get the attached file

Close Window

### Attach and remove files

• Text Formatting
• Insert Element
• Block Formatting
• Cancel
Close Window

Close Window

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