November Happy Hour will be moved to Thursday December 5th.

Help - Retrieving discount on products

Vote:
 

My problem is that I can't see/retrieve any discounts that I have created in Commerce Manager. (I have created the same type of promotion as the Quicksilver "shoe" promotion, and checked that the "id" is correct - so the promotion should apply)


What I have done so far:

 - Created a "price" property on my product - The ProductContent class.
 - Used an "addToCart" method which does the following:

void AddToCart(Entry entry, decimal quantity = 1)

{

    CartHelper cartHelper = new CartHelper(Cart.DefaultName);

    cartHelper.AddEntry(entry, quantity, false);

    cartHelper.Cart.ProviderId = "FrontEnd";

    OrderGroupWorkflowManager.RunWorkflow(cartHelper.Cart, OrderGroupWorkflowManager.CartValidateWorkflowName);

    cartHelper.Cart.AcceptChanges();

}

The following is what I have coded to "print" in the view:

var ch = new CartHelper(Cart.DefaultName);

var promotions = ch.GetCartPromotions();

- promotions does not show anything which concerns me - I believe there should be atleast 1 promotion here.

For each lineItem I try to print the "discount" but again, no discount.

Can anyone see any major steps that I do not include?

I dont havce any experience with EPiServer Commerce so there might be some concepts that I simply do not understand yet.

Any help is appriciated.

 

#142545
Dec 14, 2015 13:16
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.