I would like to setup automatic discounting based on customer discount-level (a customer custom field), where each product has fixed discounts depending on this level.
For example:
The customer entity has a custom field Discount-level, which can be level1, level2 or level3.
Each product has three custom tags:
- level-1-discount
- level-2-discount
- level-3-discount
This tag contains the exact amount to be discounted from the product price depending on the customer’s discount-level.
If the tag is empty or zero, it means no discount.
I would also need to be able to track these discounts in accounting and custom reporting.
Can anybody point me to how I best implement this (and whether it’s even possible)?
I have read several of the discounting tutorials, but haven’t seen anything that seems to be suitable for this.
One thing I’m worried might be a problem is when you first add orders to the ticket and then select/change a customer, you would have to change the discount for orders already on the ticket.
EDIT: Here’s the solution, provided by @emre:
Add a custom field Discount
to your Customer entity
Fill in this field for your customers (Under Entities
/Entities
).
D1: first discount-level
D2: second discount-level
D3: third discount-level
Under Ticket/Order Tags
, click Add Order Tag Group
:
Add these order tags:
Under Program Settings
/General Settings
, add these Custom Product Tags:
Under Products
/Product List
, for each of your products, fill in these three custom tags:
D1: amount or percentage of discount for this product if customer’s discount level is D1
D2: amount or percentage of discount for this product if customer’s discount level is D2
D3: amount or percentage of discount for this product if customer’s discount level is D3
Add the following actions under Automation
/Actions
:
Add the following rules under Automation
/Actions
:
Discount Name: {ENTITY DATA:Customer:Discount}
Discount Value:
For amount-based discount: [=-1*(TN(’{QUANTITY}’)TN(’{ITEM TAG:{ENTITY DATA:Customer:Discount}}’))]
For percentage-based discount: [=-1TN(’{PRICE}’)*(TN(’{ITEM TAG:{ENTITY DATA:Customer:Discount}}’)/100)]
Note: You need V4.1.75 or higher for this to function properly. Some issue with refreshing of the ticket was resolved in that version.
Here’s an import file for all the actions & rules and the order tag group:
customer-based-automatic-discount.zip (1.4 KB)
(You still need to do the first 5 steps manually, except for the order tag group)