AI Reports

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

ColumnWhat it means
entity_idInternal cart ID. Orders keep it in sales_order.quote_id.
store_idThe store view of the cart.
customer_id / customer_emailThe customer, or NULL for guests until they enter an email.
is_active1 = still a cart. 0 = turned into an order or replaced.
items_count / items_qtyNumber of product lines and total quantity.
base_grand_totalCart total in your base currency.
reserved_order_idThe order number reserved for it at checkout.
created_at / updated_atWhen the cart was created and last changed.

Good to know

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:

Foreign keys

All 51 columns (Magento Open Source)

Show all columns
ColumnTypeCan be emptyMagento's description
entity_idint(10) unsignedEntity ID
store_idsmallint(5) unsignedStore ID
created_attimestampCreated At
updated_attimestamp
converted_attimestampyesConverted At
is_activesmallint(5) unsignedyesIs Active
is_virtualsmallint(5) unsignedyesIs Virtual
is_multi_shippingsmallint(5) unsignedyesIs Multi Shipping
items_countint(10) unsignedyesItems Count
items_qtydecimal(12,4)yesItems Qty
orig_order_idint(10) unsignedyesOrig Order ID
store_to_base_ratedecimal(12,4)yesStore To Base Rate
store_to_quote_ratedecimal(12,4)yesStore To Quote Rate
base_currency_codevarchar(255)yesBase Currency Code
store_currency_codevarchar(255)yesStore Currency Code
quote_currency_codevarchar(255)yesQuote Currency Code
grand_totaldecimal(20,4)yesGrand Total
base_grand_totaldecimal(20,4)yesBase Grand Total
checkout_methodvarchar(255)yesCheckout Method
customer_idint(10) unsignedyesCustomer ID
customer_tax_class_idint(10) unsignedyesCustomer Tax Class ID
customer_group_idint(10) unsignedyesCustomer Group ID
customer_emailvarchar(255)yesCustomer Email
customer_prefixvarchar(40)yesCustomer Prefix
customer_firstnamevarchar(255)yesCustomer Firstname
customer_middlenamevarchar(40)yesCustomer Middlename
customer_lastnamevarchar(255)yesCustomer Lastname
customer_suffixvarchar(40)yesCustomer Suffix
customer_dobdatetimeyesCustomer Dob
customer_notetextyesCustomer Note
customer_note_notifysmallint(5) unsignedyesCustomer Note Notify
customer_is_guestsmallint(5) unsignedyesCustomer Is Guest
remote_ipvarchar(45)yesRemote Ip
applied_rule_idsvarchar(255)yesApplied Rule Ids
reserved_order_idvarchar(64)yesReserved Order ID
password_hashvarchar(255)yesPassword Hash
coupon_codevarchar(255)yesCoupon Code
global_currency_codevarchar(255)yesGlobal Currency Code
base_to_global_ratedecimal(20,4)yesBase To Global Rate
base_to_quote_ratedecimal(20,4)yesBase To Quote Rate
customer_taxvatvarchar(255)yesCustomer Taxvat
customer_gendervarchar(255)yesCustomer Gender
subtotaldecimal(20,4)yesSubtotal
base_subtotaldecimal(20,4)yesBase Subtotal
subtotal_with_discountdecimal(20,4)yesSubtotal With Discount
base_subtotal_with_discountdecimal(20,4)yesBase Subtotal With Discount
is_changedint(10) unsignedyesIs Changed
trigger_recollectsmallint(6)Trigger Recollect
ext_shipping_infotextyesExt Shipping Info
gift_message_idint(11)yesGift Message ID
is_persistentsmallint(5) unsignedyesIs Quote Persistent

Related tables

Gaurav Harsh

Gaurav Harsh is a Magento developer who works on large Adobe Commerce stores and builds AI Reports, a Magento extension for asking your store's data questions in plain English. LinkedIn