{"id":4921,"date":"2014-03-30T16:55:59","date_gmt":"2014-03-30T16:55:59","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/marketing-discounts-based-on-inventory-threshold-in-cs-2007-collection-of-common-programming-errors\/"},"modified":"2014-03-30T16:55:59","modified_gmt":"2014-03-30T16:55:59","slug":"marketing-discounts-based-on-inventory-threshold-in-cs-2007-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/marketing-discounts-based-on-inventory-threshold-in-cs-2007-collection-of-common-programming-errors\/","title":{"rendered":"Marketing &#8211; Discounts based on inventory threshold in CS 2007-Collection of common programming errors"},"content":{"rendered":"<p>Hi Fernando,<\/p>\n<p>it is not possible to\u00a0achieve\u00a0it without writing any code at all&#8230;.<\/p>\n<p>there are several way to\u00a0achieve your goal:<\/p>\n<p>1) Extending your product definition to handle a property QUANTITY SOLD and make a Catalog Expression based on it<\/p>\n<p>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 \u00a0<\/p>\n<p>2) Create a custom Targeting profile \/ property to support the quantity sold information and handle it in your targeting expressions<\/p>\n<p>you will have to retrieve and add this targeting profile at your basket everytime you add to the basket the product&#8230;. so I would\u00a0recommend\u00a0a denormalization table to store this information you can decide either to write your code at runtime to update it for each order or\u00a0populate this table from the datawharehouse data \/ or a sql job that denormalize the order tables&#8230;<\/p>\n<p>let me know if I was clear and if you have any outstanding questions.<\/p>\n<p>Stelio<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi Fernando, it is not possible to\u00a0achieve\u00a0it without writing any code at all&#8230;. there are several way to\u00a0achieve 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4921","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4921"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4921\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}