We are using Knack as portal for our resellers. I was wondering how difficult it was to create a dynamic page with discount levels. In the discount table, I needed to highlight assigned discount level based on real sales figures.
It wasn't so difficult, after all. You can easily follow these steps:
- Create a new page
- Add table "discount"
- Add table "sales figures" with any filtering logic to say what can be included in the discount threshold
- put custom javascript code below
- the code finds achieved total sales and then find a discount line with matching the conditions
- highlight the discount line
- optionally hide the sales table
- that's it
Discount page:

User Code (remove comments from the squared line to hide the sales table):

Enjoy
Michal