Skip to main content

How to fetch the row total (and unit total), including the discount in Magento 2

· 3 min read

Magento database structure can be very complex. This high complexity is especially true for the sales_order tables. These tables contain many columns with different numerical values, so fetching the data you need can be challenging.

In this article, we will show how to fetch the row total and the unit total, including discount, including or excluding tax, from the sales_order_item table in the Magento 2 database. We will show how to do that using an SQL query or programmatically.

We are a proud member of ExtDN!

· 3 min read

EXTdn logo

We are super excited to announce that we are now a part of ExtDN.

By joining ExtDN, we hope to improve the quality of our extensions further, get some insights about good development practices from other extension developers, and to contribute to the Magento ecosystem.