Guides › Database reference › Carts
Magento 2 quote table
Shopping carts. Every cart, from guests and logged-in customers, is a row here, whether or not it became an order.
Key columns
| Column | What it means |
|---|---|
entity_id | Internal cart ID. Orders keep it in sales_order.quote_id. |
store_id | The store view of the cart. |
customer_id / customer_email | The customer, or NULL for guests until they enter an email. |
is_active | 1 = still a cart. 0 = turned into an order or replaced. |
items_count / items_qty | Number of product lines and total quantity. |
base_grand_total | Cart total in your base currency. |
reserved_order_id | The order number reserved for it at checkout. |
created_at / updated_at | When the cart was created and last changed. |
Good to know
- Old carts are deleted by cron after the Quote Lifetime (days) setting (Stores › Configuration › Sales › Checkout › Shopping Cart, 30 days by default).
- Abandoned carts are usually active carts with items that haven't been updated for a while.
Example: Active carts with items in the last 7 days, and their value
Works on Magento Open Source and Adobe Commerce.
SELECT COUNT(*) AS carts, ROUND(SUM(base_grand_total), 2) AS value
FROM quote
WHERE is_active = 1
AND items_count > 0
AND updated_at >= NOW() - INTERVAL 7 DAY;
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 84 columns here instead of 51. The extra ones come from these Commerce features:
- Customer Balance:
customer_balance_amount_used,base_customer_bal_amount_used,use_customer_balance - Gift Card Account:
gift_cards,gift_cards_amount,base_gift_cards_amount,gift_cards_amount_used,base_gift_cards_amount_used - Gift Wrapping:
gw_id,gw_allow_gift_receipt,gw_add_card,gw_base_price,gw_price,gw_items_base_price,gw_items_price,gw_card_base_price,gw_card_price,gw_base_tax_amount,gw_tax_amount,gw_items_base_tax_amount,gw_items_tax_amount,gw_card_base_tax_amount,gw_card_tax_amount,gw_base_price_incl_tax,gw_price_incl_tax,gw_items_base_price_incl_tax,gw_items_price_incl_tax,gw_card_base_price_incl_tax,gw_card_price_incl_tax - Reward:
use_reward_points,reward_points_balance,base_reward_currency_amount,reward_currency_amount
Foreign keys
store_id→store.store_id
All 51 columns (Magento Open Source)
Show all columns
| Column | Type | Can be empty | Magento's description |
|---|---|---|---|
entity_id | int(10) unsigned | Entity ID | |
store_id | smallint(5) unsigned | Store ID | |
created_at | timestamp | Created At | |
updated_at | timestamp | ||
converted_at | timestamp | yes | Converted At |
is_active | smallint(5) unsigned | yes | Is Active |
is_virtual | smallint(5) unsigned | yes | Is Virtual |
is_multi_shipping | smallint(5) unsigned | yes | Is Multi Shipping |
items_count | int(10) unsigned | yes | Items Count |
items_qty | decimal(12,4) | yes | Items Qty |
orig_order_id | int(10) unsigned | yes | Orig Order ID |
store_to_base_rate | decimal(12,4) | yes | Store To Base Rate |
store_to_quote_rate | decimal(12,4) | yes | Store To Quote Rate |
base_currency_code | varchar(255) | yes | Base Currency Code |
store_currency_code | varchar(255) | yes | Store Currency Code |
quote_currency_code | varchar(255) | yes | Quote Currency Code |
grand_total | decimal(20,4) | yes | Grand Total |
base_grand_total | decimal(20,4) | yes | Base Grand Total |
checkout_method | varchar(255) | yes | Checkout Method |
customer_id | int(10) unsigned | yes | Customer ID |
customer_tax_class_id | int(10) unsigned | yes | Customer Tax Class ID |
customer_group_id | int(10) unsigned | yes | Customer Group ID |
customer_email | varchar(255) | yes | Customer Email |
customer_prefix | varchar(40) | yes | Customer Prefix |
customer_firstname | varchar(255) | yes | Customer Firstname |
customer_middlename | varchar(40) | yes | Customer Middlename |
customer_lastname | varchar(255) | yes | Customer Lastname |
customer_suffix | varchar(40) | yes | Customer Suffix |
customer_dob | datetime | yes | Customer Dob |
customer_note | text | yes | Customer Note |
customer_note_notify | smallint(5) unsigned | yes | Customer Note Notify |
customer_is_guest | smallint(5) unsigned | yes | Customer Is Guest |
remote_ip | varchar(45) | yes | Remote Ip |
applied_rule_ids | varchar(255) | yes | Applied Rule Ids |
reserved_order_id | varchar(64) | yes | Reserved Order ID |
password_hash | varchar(255) | yes | Password Hash |
coupon_code | varchar(255) | yes | Coupon Code |
global_currency_code | varchar(255) | yes | Global Currency Code |
base_to_global_rate | decimal(20,4) | yes | Base To Global Rate |
base_to_quote_rate | decimal(20,4) | yes | Base To Quote Rate |
customer_taxvat | varchar(255) | yes | Customer Taxvat |
customer_gender | varchar(255) | yes | Customer Gender |
subtotal | decimal(20,4) | yes | Subtotal |
base_subtotal | decimal(20,4) | yes | Base Subtotal |
subtotal_with_discount | decimal(20,4) | yes | Subtotal With Discount |
base_subtotal_with_discount | decimal(20,4) | yes | Base Subtotal With Discount |
is_changed | int(10) unsigned | yes | Is Changed |
trigger_recollect | smallint(6) | Trigger Recollect | |
ext_shipping_info | text | yes | Ext Shipping Info |
gift_message_id | int(11) | yes | Gift Message ID |
is_persistent | smallint(5) unsigned | yes | Is Quote Persistent |