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

[Ecommerce] Product discount not being reflected in the Order Object #77

Open
IgorBenko opened this issue Feb 22, 2021 · 3 comments
Open

Comments

@IgorBenko
Copy link
Contributor

Bug Report

Before doing any further steps (pull request/workaround) I would like to understand if the following is expected behaviour, a missing feature or just plain false understanding of the feature on my side.

The feature I am describing would be needed for a proper communication with an ERP system.

Issue description

When applying a voucher adding a product discount, the product discount doesn't seem to be reflected in any way in the final Order object. The cart discount is on the other hand clearly reflected under Price Modifications.

2021-02-22_22-46-43

2021-02-22_22-47-04

The applied Pricing Rule is saved with an ID to the Order Item. This might not be enough as the pricing rule might change and afterwards there is no way to understand how the Product Price was discounted.

Expected behavior

The reason for the Product Discount and the value of a discount are clearly reflected in the Order Object.

Actual behavior

Only the discounted Product Price is being persisted with a Pricing Rule ID (in Order-Item), which might not be enough to properly understand the final Order.

Steps to reproduce

Create following pricing rules.
2021-02-22_22-55-49
2021-02-22_22-55-52
2021-02-22_22-56-11
2021-02-22_22-56-14

Then make two orders:

  • with product-discount voucher
  • with cart-discount voucher

I hope I am not missing something obvious here :) Feedback is highly appreciated! Thanks

@fashxp
Copy link
Member

fashxp commented Feb 23, 2021

Hi,
this absolutely makes sense.

I see two possible ways to fix this:

  • add two additional fields (originalPrice, originalNetPrice) to the order item and store there the not-discounted price
  • add the price information to the pricing-rule field collection and store the discounts for every pricing rule there.

I'm not sure, if the second way will work though - first I'm not sure, if we have the necessary information available when order items are written, and second there might be pricing rules that have other actions that product discount...

@IgorBenko
Copy link
Contributor Author

Hi Christian,

thanks a lot for your prompt reply! Yes your suggestions make sense. The first suggestion seems doable and doesn't exclude a later implementation of your second suggestion.

We will evaluate the options and try to implement an appropriate solution.

Thank you!

@fashxp
Copy link
Member

fashxp commented Feb 23, 2021

A PR would be awesome :)

@brusch brusch transferred this issue from pimcore/pimcore May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants