Hi,
I need to know if a product has a discount or not in a ProductIndexBuilder/ExtendDocument().
The purpose is to enrich other fields with values depending on whether a product has a discount or not.
- I would like to avoid Services.Discounts.GetDiscounts() as there are many rules that must be followed for a discount.
- I have tried listening on the IndexDocument parameters, but there are all price values 0. The IndexDocument does not return the before price and the discount price - only a price.
- I've tried Services.Products.GetProductById(), GetDiscountMatrix() and GetPrice() but they require a Dynamicweb.Context.Current context.
I would prefer the last approach (Services.Products), as I see advantages in being able to take data directly from the product service.
Is it possible to declare a Dynamicweb.Context.Current context?
Is there another approach?
Regards,
Casper