close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

discount difficulty

Thread began 6/01/2011 4:27 pm by CraigR | Last modified 6/08/2011 4:12 pm by CraigR | 1388 views | 16 replies

CraigRBeta Tester

Getting there.

I started off simply until I got this working as intended.


To start with, I added 3 fields to my cart object


Discount1to9; Discount10to49; Discount50to100


I added the calculation field as described

((abs([DiscountGroup] == 'A' && ([Quantity] >= '1' && [Quantity] <= '9'))*[Discount1to9]) + (abs([DiscountGroup] == 'A' && ([Quantity] >= '10' && [Quantity] <= '49'))*[Discount10to49]) + (abs([DiscountGroup] == 'A' && ([Quantity] >= '50' && [Quantity] <= '100'))*[Discount50to100])) * [Quantity]


On my add to cart page, for testing purposes, I have set the discounts for each quantity break to 10% 20% and 30%

To start with, I have added a new discount rule, whose calculation is the subtotal of column 'itemDiscount'.
As the trigger, I have set ‘Total Number of Items > 0’.
This seems to give me the desired result.

With Discount group A items… If I add 10 of Item 1 and 5 of item 2, my discount calculates as 20% of Item 1 and 10% of item 2
I can even put the discount amount in line with each cart item – great.
(I assume by this method, I will only ever get one line under the discounts section, so in order to have some clarity re the discount applied, I need to use the inline method I mentioned above)

I now need to take this 2 stages further.
1. Include Discount Group B, C, D etc in the calculation field
2. Set different price breaks for each Discount Group.

I presume, to achieve stage 1, I just extend the calculation as follows…

((abs([DiscountGroup] == 'A' && ([Quantity] >= '1' && [Quantity] <= '9'))*[Discount1to9]) + (abs([DiscountGroup] == 'A' && ([Quantity] >= '10' && [Quantity] <= '49'))*[Discount10to49]) + (abs([DiscountGroup] == 'A' && ([Quantity] >= '50' && [Quantity] <= '100'))*[Discount50to99]) + (abs([DiscountGroup] == 'B' && ([Quantity] >= '1' && [Quantity] <= '9'))*[Discount1to9]) + (abs([DiscountGroup] == 'B' && ([Quantity] >= '10' && [Quantity] <= '49'))*[Discount10to49]) + (abs([DiscountGroup] == 'B' && ([Quantity] >= '50' && [Quantity] <= '100'))*[Discount50to99]) + (abs([DiscountGroup] == 'C' && ([Quantity] >= '1' && [Quantity] <= '9'))*[Discount1to9]) + (abs([DiscountGroup] == 'C' && ([Quantity] >= '10' && [Quantity] <= '49'))*[Discount10to49]) + (abs([DiscountGroup] == 'C' && ([Quantity] >= '50' && [Quantity] <= '100'))*[Discount50to99]) + (abs([DiscountGroup] == 'D' && ([Quantity] >= '1' && [Quantity] <= '9'))*[Discount1to9]) + (abs([DiscountGroup] == 'D' && ([Quantity] >= '10' && [Quantity] <= '49'))*[Discount10to49]) + (abs([DiscountGroup] == 'D' && ([Quantity] >= '50' && [Quantity] <= '100'))*[Discount50to99])) * [Quantity]

…to include all Discount Groups.

Can you please elaborate on how I could achieve what you stated in your email

…(you can get really crazy though and set the quantity breaks on an item by item basis by adding a low high column for each quantity level). Using an example where the price breaks for Discount group A were as before, (1-9, 10-49, 50-100) and the price breaks for Discount Group B are 10-24, 25-100, 101-999)
Thanks in advance

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