Magento Database – Use of Quote Tables in magento:
After, product added to the cart by customer/admin (when admin create a order from admin section), then some table are update in magento database, Those tables are normally called Quote Tables. Once customer added product to the cart, they will complete the order successfully or it may failure or it may canceled by the customer, whatever it may happen. So up to order completion, those cart details are maintained by this tables. Mainly below tables are helpful to store the customer cart detail in magento
1. sales_flat_quote
2. sales_flat_quote_item
3. sales_flat_quote_item_option
4. sales_flat_quote_address
5. sales_flat_quote_address_item
6. sales_flat_quote_payment
7. sales_flat_quote_shipping_rate
Table :1 sales_flat_quote:
This table is act as a main table when customer add to the product into cart.Once product is added by the customer (or) admin from admin section(when admin added to the cart from admin section order creation) a new row will be create in this row. For each quote order, only one line item or only one row will create in this table. If customer add more than one qty, or more than one product then also only one row will create in this table. Here, we will get total price total qty (if more than one products or qty,then will get some more than one product price)
product added to cart date,store ID,Currency code,customer detail like mail ID, name,etc…
Table :2 sales_flat_quote_item:
This table is next main table in the quote stage.From above table only one row will create, but here it may more than one row also its based on the no.of product added to the cart by customer.
Ex: Customer is added two different product into the cart, then two row’s will create in this table.Each line , each row will create in this table.Will each line item detail like price, attribute values (if available),Product detail,store ID,no.of qty,etc..
Table : 3 sales_flat_quote_item_option:
If only simple product is used in a website, then there is no use of this table. If other than simple product like, configurable, or bundle, etc then this table use will come know.Say for example, configurable product have different attribute option available like color,size of product, etc.. those value will be stored in this table.
Table :4 sales_flat_quote_address:
Quote address details will get it from this table. When customer trying to place the order (order not placed, may customer is in checkout page) they will chose the address or create a address for billing / shipping purpose. Those address detail will get it from here.
Table :5 sales_flat_quote_address_item:
As per my understanding, if multiple shipping is (depend on multiple line item) available then this table is helpful.
Table :6 sales_flat_quote_payment:
When customer trying to place the order before, they will chose the payment method in checkout, those payment methods details will get it from here.
Ex: Customer choose the payment method credit card in checkout page, before pay the money, customer check the cart page once and again back to checkout page, in that time credit card checkout box will choose by default this is based on this table only.
Table :7 sales_flat_quote_shipping_rate:
This also similarly above table. Before placing the order customer if choose any shipping method, then the shipping method price and all will update or insert into this table.