# Discounts on unigue items

Thread began 8/13/2014 10:19 am by jon392819 | Last modified 8/13/2014 3:10 pm by Jason Byrnes | 2207 views | 13 replies |

## 8/13/2014 10:19 am  |  #1 jon392819

### Discounts on unigue items

Hi Guys, cant work this out. I have thousands of products. We want to offer a percentage discount on each unique item in the cart based on the qty of that unique item. Not the combined qty of the cart.

Imagine the cart has3 items in it.

if item one has a qty of 5 or more the price of the item is discounted by 5%

If item 2 only has a qty of one its price is not discounted

If item 3 has a qty of over 10 its price per item is discounted by 10%

We are looking to discount every item individually based on their qty in the cart.

I was hoping to create a rule that said something like, get the count of each each unique id in cart, if over 5 apply a discount of 5%

Is this possible. Thanks

Jon

## 8/13/2014 11:40 am  |  #2 Jason ByrnesWebAssist

on the calculations tab, create a new calculation as:

discountAmount
(abs([Quantity] >= 5 && [Quantity] < 10)?[Price] * 0.05:0) + (abs([Quantity] >= 5 && [Quantity] < 10)?[Price] * 0.1:0)

then on the discount tab, create a discount as:
Trigger:
Subtotal of column discount amount > 0

calculation:
Subtotal of column discountAmount plus 0

## 8/13/2014 11:53 am  |  #3 jon392819

Thanks Jason, the above worked super for the 5%. How do add in other qty breakpoints so if an item has qty between 11 and 20 they get a higher discount.

Many thanks Jason

## 8/13/2014 12:00 pm  |  #4 Jason ByrnesWebAssist

sorry, should have been:
(abs([Quantity] >= 5 && [Quantity] < 10)?[Price] * 0.05:0) + (abs([Quantity] >= 10 && [Quantity] < 20)?[Price] * 0.1:0)

## 8/13/2014 12:10 pm  |  #5 jon392819

Ah, I got it. If I'd engaged my brain for a second I should have gotten that. I presume I can use the example and add other breakpoints like

(abs([Quantity] >= 5 && [Quantity] < 10)?[Price] * 0.05:0) + (abs([Quantity] >= 10 && [Quantity] < 20)?[Price] * 0.1:0) + (abs([Quantity] >= 20 && [Quantity] < 30)?[Price] * 0.2:0)

## 8/13/2014 12:14 pm  |  #6 Jason ByrnesWebAssist

yup, that's correct.

## 8/13/2014 12:48 pm  |  #7 jon392819

Hi Jason, tried to run the display manager wizard again to include the discount info under each product but get the attached error. Other ecart sites I have do not share the same. Cleared cache but no luck.
Also Jason, is it possible to show the discount applied to each item in the cart.

I also cant work out how the above calculation gets worked out on a unique product. Where in the above does the code get told do this for each item and not the combined qty of the cart?

Apologies for the questions....

J

## 8/13/2014 1:57 pm  |  #8 Jason ByrnesWebAssist

instead of running the display manager to recreate the desplay use the bindings panel to add the discountAmount amount binding to the cart display.

calculations are performed on a line by line basis, just by doing the discount as a calculation is how you ensure that it is applied to unique items and not the cart total quantity.

## 8/13/2014 2:18 pm  |  #9 jon392819

Thanks Jason, I see the bindings thanks. I think I gave you the wrong idea above. I need to discount to be a percentage of the total cost for the item.

If item x has a price of 1 Euro and it has qty of 3 the discount would be 3 Euro - 5%.

At the minute I think we are just working out the discount on the Item price and taking that from the total.

Also, at the minute when I add two different items to the cart each with a different price per unit and a qty of 6 or more they both get the exact same discount showing. Appreciate this may heading to a premium ticket.

I attach a screen shot. Thanks Jason

Jon

## 8/13/2014 2:23 pm  |  #10 Jason ByrnesWebAssist

ok, so multiply the price * quantity in the calculation:

(abs([Quantity] >= 5 && [Quantity] < 10)?([Price] * [Quantity]) * 0.05:0) + (abs([Quantity] >= 10 && [Quantity] < 20)?([Price] * [Quantity]) * 0.1:0)

send a copy ofd the cart display page please.

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