OrchardCMS / OrchardCMS/OrchardCore.Commerce

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

Open
#397 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
231
Forks
94
Avg merge
7d 7h
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in PaymentService.CreateOrUpdateOrderFromShoppingCartAsync and trace the _shoppingCartHelpers.CreateOrderLineItemsAsync call. Compare how product discounts are handled before OrderLineItems are stored, then verify that completed orders show the discounted unit and line prices rather than the original prices.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, payments
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.