devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

Clear out confusions about prices in Magento 2 sales order items

Open ioweb-gr opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What's missing?

There seems to be some confusion about sales order items and what each price stored in the database means. You can check stackoverflow and you'll see literally dozens of questions regarding this.

Would it be possible to add a clarification about them?

base_discount_amount
base_discount_tax_compensation_amount
base_original_price
base_price
base_price_incl_tax
base_row_total
base_row_total_incl_tax
base_tax_amount
base_tax_before_discount
discount_amount
discount_percent
discount_tax_compensation_amount
original_price
row_total
row_total_incl_tax
tax_amount
tax_before_discount
tax_percent

E.g.

  • we understand base is the prices without any currency conversions on the default currency of the store
  • we understand that if the suffix incl_tax is in the item, it refers to including tax so we can understand if it's missing then the price is without tax.

However there's no explanation for example what the original price is, what the discount_tax_compensation_amount is or whether the price includes discount amounts or not.

There is no hint of documentation in the classes either to go by.

\Magento\Sales\Api\Data\OrderItemInterface

ioweb-gr avatar Jan 15 '23 09:01 ioweb-gr

Hi @ioweb-gr. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Jan 15 '23 09:01 m2-assistant[bot]