The restrictive discount feature in the Boutique Web Application

The Boutique store sells clothing online: the catalogue of this boutique can be viewed on a website, and clients can place their orders online. A client adds products from the catalogue to a virtual shopping cart in a dedicated page, which displays each product added with its price. Besides, this page contains a checkout form asking for a desired payment method.

The sequence for the restrictive discount feature

Now, consider that we need to add the discount restrictive feature, which potentially adds a different discount for each product when it is added to the shopping cart. The discounts are applied when the client does checkout. Each discount is only valid for a period of time; however, the discount feature must respect the discount that was active when the product was added to the shopping cart. The restrictive discount feature limits the number of discounts are really applied (say three): they are the discounts that generate the best benefits for the client. In addition, all discounts are only valid if the client does checkout before Christmas Day. The sequence shown in the figure implements this new feature in a hypothetically TM that matches this sequence before Christmas Day and with a matching strategy that matches only one sequence at a time. When this sequence matches, it contains as contextual information a list of all products and discounts. The associated advice applies the discounts to the products of the list that generate the best benefits according to the store policy.

The implementation follows:

Toggle between the code and example

  • otm/paperexample.txt
  • Last modified: 2010/06/03 13:11
  • by aspectscript