Sitecore E-Commerce Module - Discount/Promotional Codes

Posted by Zachary Kniebel on Stack Overflow See other posts from Stack Overflow or by Zachary Kniebel
Published on 2012-09-05T15:12:48Z Indexed on 2012/09/05 15:38 UTC
Read the original article Hit count: 238

Filed under:
|
|
|
|

I am working on a project for which I must use Sitecore's E-Commerce Module (and Sitecore 6.5 rev. 120706 - aka 'Update 5') to create a web-store. One of the features that I am trying to implement is a generic promotional/discount code system - customer enters a code at checkout which grants a discount like 'free shipping', '20% off', etc. At the moment, I am looking for some guidance (a high-level solution, a few pseudo-ideas, some references to review, etc) as to how this can be accomplished.


Summary:

What I am looking for is a way to detect whether or not the user entered a promo code at a previous stage in the checkout line, and to determine what that promo code is, if they did.


Progress Thus Far:

I have thoroughly reviewed all of the Sitecore E-Commerce Services (SES) documentation, especially "SES Order Line Extension" documentation (which I believe will have to be modified/extended in order to accomplish this task).

Additionally, I have thoroughly reviewed the Sitecore Community article Extending Sitecore E-Commerce - Pricing and believe that it may be a useful guide for applying a discount statically, but does not say much in the way of applying a discount dynamically.

After reviewing these documents, I have come up with the following possible high-level solution to start from:

  1. I create a template to represent a promotional code, which holds all data relevant to the promotion (percent off, free shipping, code, etc).
  2. I then create another template (based on the Product Search Group template) that holds a link to an item within a global "Promotional Code" items folder.
  3. Next, I use the Product Search Group features of my new template to choose which products to apply the discount to.
  4. In the source code for the checkout I create a class that checks if a code has been entered and, if so, somehow carry it through the rest of the checkout process. This is where I get stuck.


More Details:

  • No using cookies
  • No GET requests
  • No changing/creating/deleting items in the Sitecore Database during the checkout process (e.g., no manipulation of fields of a discount item during checkout to signal that the discount has been applied)
  • must stay within the scope of C#


Last Notes:

I will update this post with any more information that I find/progress that I make.

I upgrade all answers that are relevant and detailed, thought-provoking, or otherwise useful to me and potentially useful to others, in addition to any high-level answers that serve as a feasible solution to this problem; even if your idea doesn't help me, if I think it will help someone else I will still upgrade it.


Thanks, in advance, for all your help! :)

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET