Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateOrderLineItemsAsync does not take care of product discounts (OCC-214) #397

Open
dpomt opened this issue Jan 10, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@dpomt
Copy link

dpomt commented Jan 10, 2024

Hi,

I am using price discounts.
This works fine except that the discounts are not applied on OrderLineItems when stored in Order.

In PaymentService.CreateOrUpdateOrderFromShoppingCartAsync _shoppingCartHelpers.CreateOrderLineItemsAsync is called to get the items to store in the order. But within that method, product discounts are not applied.

image

Hence when displaying a completed order, you don't see the discounted prices (unit price and line price) paid but the original prices.

Jira issue

@dpomt dpomt added the bug Something isn't working label Jan 10, 2024
@github-actions github-actions bot changed the title CreateOrderLineItemsAsync does not take care of product discounts CreateOrderLineItemsAsync does not take care of product discounts (OCC-214) Jan 10, 2024
@dpomt
Copy link
Author

dpomt commented Jan 17, 2024

This could be fixed in Payment/Services/PaymentService.cs in methods CreatePendingOrderFromShoppingCartAsync and CreateOrUpdateOrderFromShoppingCartAsync:

Instead of _shoppingCartHelpers.CreateOrderLineItemsAsync(cart) call _shoppingCartHelpers.CreateOrderLineItemsAsyncEx(cartViewModel)
(created CreateOrderLineItemsAsyncEx similar to existing CreateOrderLineItemsAsync but accepting the view model of the cart instead of the cart itself).

This also fixes my issue that shipping costs added to the view model lines via IShoppingCartEvents:ViewModelCreatedAsync were not part of the order (#4 ).

Could the standard implementation get changed this way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant