Replies: 2 comments 1 reply
-
My RetailSDk customassign the PriceEvent as follow: using PE = Microsoft.Dynamics.Commerce.Runtime.Services.PricingEngine; PE.PricingEngineExtensionRepository.GetPriceEvents().PrePriceRoundingAdjustments += (sender, args) => {
So how do I do the above with what Microsoft suggested? |
Beta Was this translation helpful? Give feedback.
-
In the RetailSDK to CommerceSDK documentation Microsoft had for the longest time that the only nuget package reference needed was Runtime. The documentation was updated in May 2023 according to the timestamp on the doc, which I only discovered recently that it was updated, to also include the nuget package of the Pricing engine. After I added this nuget package to my CommerceSDK CommerceRuntime project, I was able to access PricingEngineExtensionRepository. So this is working now. |
Beta Was this translation helpful? Give feedback.
-
We have custom on RetailSDK where I add to the PriceEvents to round the AdjustedPrice and then call the PricingEngine.
I cannot call the pricing engine directly with CommerceSDK.
I received the following from Microsoft on how to add it but it doesn't make sense to me.
PricingEngineExtensionRepository is in Microsoft.Dynamics.Commerce.Runtime.Services.PricingEngine, but the latter is not accessible in CommerceSDK.
So how do I do the following that I received from Microsoft:
For extension, customer can create extension like the one below for CalculatePricesServiceRequest
CalculateDiscountsServiceRequest, GetIndependentPriceDiscountServiceRequest
, PricingEngineExtensionRepository.GetPriceEvents().PostPriceRoundingAdjustments += (sender, args) =
{ // Round SalesAgreementPrice, BasePrice, AgreementPrice, AdjustedPrice };
await this.ExecuteNextAsync;
Response(request, skipRequestTriggers: false).ConfigureAwait(false);
My RetailSDk customassign the PriceEvent as follow:
Beta Was this translation helpful? Give feedback.
All reactions