cancel
Showing results for 
Search instead for 
Did you mean: 

Where is the weight of item WHEN IT'S PURCHASED stored on database?

SOLVED

Where is the weight of item WHEN IT'S PURCHASED stored on database?

Hi I'm very new to Magento 2.

 

It is retrieved from the weight field on Product Detail Page when the item is purchased. However, it should not change when the weight field on Product Detail Page is edited after the purchase.

 

Is there such field on Magento 2 db? If so, please let me know the sql.

Thank you for your help in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Where is the weight of item WHEN IT'S PURCHASED stored on database?

HI @makoto_matsumot,

Basically magento stores product data in EAV tables. When you update any product then these are updated. 

Once you add a product into cart then magento stores that product data into quote_item table. It will change (if product weight is updated) untill you place the order. 

If you place the order then product data are stored in the sales_order_item table. It will never change. 

If you place any new order then also there will be new row entry, but previous one will never change. 

I hope it is clear now, or ask if you have any question. 

The 
sales_order_item table 

View solution in original post

4 REPLIES 4

Re: Where is the weight of item WHEN IT'S PURCHASED stored on database?

Hello @makoto_matsumot 

 

The product weight is stored in the quote_item table and sales_order_item table.

 

Hope it helps.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

Re: Where is the weight of item WHEN IT'S PURCHASED stored on database?

Thank you Meetanshi!

 

These two tables have the weight recorded when the item is purchased so even if I change the weight of item on Product page after the purchase, these two tables are not affected at all. Is this correct?

 

April 1st, 2019) Item A(400g) is purchased

May 2nd, 2019) Item A's weight is edited from 400g to 500g

 

Item A's weight on both quote_item and sales_order_item is still 400g

Re: Where is the weight of item WHEN IT'S PURCHASED stored on database?

Hello again @makoto_matsumot 

 

The sales_order_item table is not affected until the next order is placed.

 

Hope it helps.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

Re: Where is the weight of item WHEN IT'S PURCHASED stored on database?

HI @makoto_matsumot,

Basically magento stores product data in EAV tables. When you update any product then these are updated. 

Once you add a product into cart then magento stores that product data into quote_item table. It will change (if product weight is updated) untill you place the order. 

If you place the order then product data are stored in the sales_order_item table. It will never change. 

If you place any new order then also there will be new row entry, but previous one will never change. 

I hope it is clear now, or ask if you have any question. 

The 
sales_order_item table