# Discount with different triggers.

Thread began 6/29/2012 10:18 am by geertwijns177986 | Last modified 6/29/2012 4:53 pm by Jason Byrnes | 209 views | 3 replies |

## 6/29/2012 10:18 am  |  #1 geertwijns177986

### Discount with different triggers.

Customers can fill in a textfield for a sticker (text-decal).

I want to make a discount when the customer orders more than 2 pieces* of this item (ID 829), but the column values "Size" & "EigenTekst" (textfield) has to be the same.
* 3-5 pcs : -20% * 6-9 : -30% * >=10 : -35%

I can't make this trigger in the eCart Object.
The trigger I already have is just a little start. Now it checks only when quantity = 3 and when Size = 15 cm, but Sizes are from 5 tot 100 cm in steps of 5 cm.
The discount result now (for testing) is the "TotalPrice"/2, but it must be calculated on the above conditions.

Is it possible to let this work ?

<%
function WAEC_stickersBE_MoreThanOne()
totalDiscount = 0
if (true AND ((WA_eCart_ConditionalTotal(stickersBE, "Quantity", "ID", "829") = 3) AND (WA_eCart_ConditionalTotal(stickersBE, "Quantity", "Size", "15") = 3))) then
totalDiscount = totalDiscount + (WA_eCart_ConditionalTotal(stickersBE, "TotalPrice", "ID", "829") / cDbl(2))'Result
end if
WAEC_stickersBE_MoreThanOne = WA_eCart_FormatNumber(totalDiscount, stickersBE.ForceDecimalsC, stickersBE.DecimalPlacesC)
end function
%>

Geert.

WAeCart 4.5.2 - Asp Vbscript

## 6/29/2012 12:01 pm  |  #2 Jason Byrnes

i'm not sure i understand what you mean by:

"but the column values "Size" & "EigenTekst" (textfield) has to be the same."

please explain that in more detail.

## 6/29/2012 12:14 pm  |  #3 geertwijns177986

When choosing 2 stickers with Size 15 cm and 1 sticker with Size 25 cm, this doesn't count for 3 same pieces.
"EigenTekst" : the input also has to be the same. 2 stickers "I love my dog" and 1 sticker " I love my cat" doesn't count for 3 same pieces.
The discount is only for exactly the same ordered items (stickers).
E.g.:
3 stickers "I love my dog" - 15 cm >>> discount OK : -20%

2 stickers "I love my dog" - 15 cm + 1 sticker "I love my cat" - 15 cm >>> discount NOT OK

## 6/29/2012 4:53 pm  |  #4 Jason Byrnes

in the cart object, make sure the Size and text columns are set to unique.

On the calculations tab, create a new calculation as:

totalDiscount:

(Abs([ID] = 829 AND [Quantity] >= 3 AND [Quantity] <= 5) * ([Price] * 0.2)) + (Abs([ID] = 829 AND [Quantity] >= 6 AND [Quantity] <= 9) * ([Price] * 0.25)) + (Abs([ID] = 829 AND [Quantity] >= 10) * ([Price] * 0.3))

the on the discounts tab, create a new discount using the trigger:
Subtotal For Any Column;
If the Subtotal for column "totalDiscount" is ">" "0"

calculation:
Based on column subtotal:
subtotal of column "totalDiscount" "plus" "0"

## 11/03/2012 12:52 pm  |  #5 geertwijns177986

I can not make it work.

Is there a possibility that you implement this discount rule when I choose support with a "premium ticket" ?

## 11/05/2012 1:38 pm  |  #7 geertwijns177986

ok ... how do I start ... I just submit the ticket with the same question ?

## 11/05/2012 1:41 pm  |  #8 Jason Byrnes

yes, that is correct.

Visit the Support landing page, and click the Premiere ticket link top begin the process of submitting the question.

## 11/08/2012 1:59 am  |  #9 geertwijns177986

I still didn't got any respons from my premium ticket 147326 !?

## 11/08/2012 11:33 am  |  #10 Jason Byrnes

Please respond to the ticket with a US phone number or Skype address and we will arrange a contact time to look into the ticket with you.

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