Marketing – Discounts based on inventory threshold in CS 2007-Collection of common programming errors

Hi Fernando,

it is not possible to achieve it without writing any code at all….

there are several way to achieve your goal:

1) Extending your product definition to handle a property QUANTITY SOLD and make a Catalog Expression based on it

and you will have to write the code to update your product for each order that is placed in a pipeline component or operation sequence or eventually get this information back with a sql script / datawharehouse from the order table  

2) Create a custom Targeting profile / property to support the quantity sold information and handle it in your targeting expressions

you will have to retrieve and add this targeting profile at your basket everytime you add to the basket the product…. so I would recommend a denormalization table to store this information you can decide either to write your code at runtime to update it for each order or populate this table from the datawharehouse data / or a sql job that denormalize the order tables…

let me know if I was clear and if you have any outstanding questions.

Stelio