pimcore / ecommerce-framework-bundle

Ecommerce Framework community bundle provides e-commerce functionality such as product listing and filtering, pricing, carts and checkouts for Pimcore.
https://pimcore.com/docs/platform/Ecommerce_Framework/
Other
8 stars 30 forks source link

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

Open IgorBenko opened 3 years ago

IgorBenko commented 3 years ago

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:

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

fashxp commented 3 years ago

Hi, this absolutely makes sense.

I see two possible ways to fix this:

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 commented 3 years ago

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 commented 3 years ago

A PR would be awesome :)