Guides › Database reference › Carts
Magento 2 quote_item table
The products in each cart. Like order items, configurable and bundle products have a parent row plus child rows.
Key columns
| Column | What it means |
|---|---|
item_id | Internal ID of the cart line. |
quote_id | The cart, linking to quote.entity_id. |
parent_item_id | NULL for top-level lines; set on the chosen variant of a configurable product. |
product_id / sku / name | The product in the cart. |
qty | Quantity in the cart. |
price / row_total | Unit price and line total. |
Good to know
- Count only
parent_item_id IS NULLto avoid counting configurable products twice.
Example: Products most often sitting in active carts
Works on Magento Open Source and Adobe Commerce.
SELECT qi.sku, MAX(qi.name) AS name, COUNT(DISTINCT qi.quote_id) AS carts, SUM(qi.qty) AS qty
FROM quote_item qi
JOIN quote q ON q.entity_id = qi.quote_id AND q.is_active = 1
WHERE qi.parent_item_id IS NULL
GROUP BY qi.sku
ORDER BY carts DESC
LIMIT 20;
Tested on Magento Open Source and Adobe Commerce 2.4.8. Read-only. If your tables have a prefix, add it to each table name.
Extra columns on Adobe Commerce
Adobe Commerce has 60 columns here instead of 53. The extra ones come from these Commerce features:
- Catalog Event:
event_id - Gift Registry:
giftregistry_item_id - Gift Wrapping:
gw_id,gw_base_price,gw_price,gw_base_tax_amount,gw_tax_amount
Foreign keys
parent_item_id→ quote_item.item_idquote_id→ quote.entity_idstore_id→store.store_id
All 53 columns (Magento Open Source)
Show all columns
| Column | Type | Can be empty | Magento's description |
|---|---|---|---|
item_id | int(10) unsigned | Item ID | |
quote_id | int(10) unsigned | Quote ID | |
created_at | timestamp | Created At | |
updated_at | timestamp | Updated At | |
product_id | int(10) unsigned | yes | Product ID |
store_id | smallint(5) unsigned | yes | Store ID |
parent_item_id | int(10) unsigned | yes | Parent Item ID |
is_virtual | smallint(5) unsigned | yes | Is Virtual |
sku | varchar(255) | yes | Sku |
name | varchar(255) | yes | Name |
description | text | yes | Description |
applied_rule_ids | text | yes | Applied Rule Ids |
additional_data | text | yes | Additional Data |
is_qty_decimal | smallint(5) unsigned | yes | Is Qty Decimal |
no_discount | smallint(5) unsigned | yes | No Discount |
weight | decimal(12,4) | yes | Weight |
qty | decimal(12,4) | Qty | |
price | decimal(20,4) | Price | |
base_price | decimal(20,4) | Base Price | |
custom_price | decimal(20,4) | yes | Custom Price |
discount_percent | decimal(12,4) | yes | Discount Percent |
discount_amount | decimal(20,4) | yes | Discount Amount |
base_discount_amount | decimal(20,4) | yes | Base Discount Amount |
tax_percent | decimal(12,4) | yes | Tax Percent |
tax_amount | decimal(20,4) | yes | Tax Amount |
base_tax_amount | decimal(20,4) | yes | Base Tax Amount |
row_total | decimal(20,4) | Row Total | |
base_row_total | decimal(20,4) | Base Row Total | |
row_total_with_discount | decimal(20,4) | yes | Row Total With Discount |
row_weight | decimal(12,4) | yes | Row Weight |
product_type | varchar(255) | yes | Product Type |
base_tax_before_discount | decimal(20,4) | yes | Base Tax Before Discount |
tax_before_discount | decimal(20,4) | yes | Tax Before Discount |
original_custom_price | decimal(20,4) | yes | Original Custom Price |
redirect_url | varchar(255) | yes | Redirect Url |
base_cost | decimal(12,4) | yes | Base Cost |
price_incl_tax | decimal(20,4) | yes | Price Incl Tax |
base_price_incl_tax | decimal(20,4) | yes | Base Price Incl Tax |
row_total_incl_tax | decimal(20,4) | yes | Row Total Incl Tax |
base_row_total_incl_tax | decimal(20,4) | yes | Base Row Total Incl Tax |
discount_tax_compensation_amount | decimal(20,4) | yes | Discount Tax Compensation Amount |
base_discount_tax_compensation_amount | decimal(20,4) | yes | Base Discount Tax Compensation Amount |
weee_tax_applied | text | yes | Weee Tax Applied |
weee_tax_applied_amount | decimal(12,4) | yes | Weee Tax Applied Amount |
weee_tax_applied_row_amount | decimal(12,4) | yes | Weee Tax Applied Row Amount |
weee_tax_disposition | decimal(12,4) | yes | Weee Tax Disposition |
weee_tax_row_disposition | decimal(12,4) | yes | Weee Tax Row Disposition |
base_weee_tax_applied_amount | decimal(12,4) | yes | Base Weee Tax Applied Amount |
base_weee_tax_applied_row_amnt | decimal(12,4) | yes | Base Weee Tax Applied Row Amnt |
base_weee_tax_disposition | decimal(12,4) | yes | Base Weee Tax Disposition |
base_weee_tax_row_disposition | decimal(12,4) | yes | Base Weee Tax Row Disposition |
gift_message_id | int(11) | yes | Gift Message ID |
free_shipping | smallint(5) unsigned | Free Shipping |