9

Magento version: 2.0.0

When user add products into cart, where are they saved? $_SESSION or Database? If it is in database, which table?

17

Magento2, save cart details at Quote tables.

  • For Cart general details use quote table .
  • Carts item details at quote_item.
  • Cart items option details at quote_item_option

Additional:

  • Checkout Addressed details at quote_address.
  • Checkout payment details at quote_payment.

Magento2 use Quote module Magento_Quote (vendor/magento/module-quote) for save all Cart general,items detail,address details etc.

And Mage_Checkout module's Session Cart model make relation between user,session with Cart details

enter image description here

| improve this answer | |
  • How do i get values from quote_address table? – jibin george Oct 17 '19 at 13:03
  • YOu have to use Magento\Quote\Model\Quote\Address or have to use quote QuoteRepository – Amit Bera Oct 17 '19 at 13:23
  • $shippingId = $order->getShippingAddress()->getId(); $address = $objectManager->create('Magento\Quote\Model\Quote\Address')->load($shippingId); var_dump($address)->getData(); = NULL it didnt give me any data – jibin george Oct 17 '19 at 13:34
  • @AmitBera, How can I collect abandoned cart details? Please answer to the question stackoverflow.com/questions/59643279/… – Siva Jan 8 at 10:38
  • @AmitBera I am facing a strange issue where on restore cart data is considered abandoned. Can you help on this? – Arjun Jul 17 at 12:08
0

quote table is not cart. If you delete quote from DB raw by entity_id it will be restored with new entity_id. It will have all items.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.