0

I am creating a module that is going to save orders to a .csv file. The problem now is that I need both the name of the product and the name of the customer. As far as I know these are not stored in the same mysql table. I can get the customer name form the "sales_order" table and the product name form the "sales_order_item". "sales_order" has an id called "entity_id" and "sales_order_item" has an id called "order_id". Are these ids the same?

Or is there a better way of doing this?

asked Jun 6, 2017 at 11:09

1 Answer 1

5

Yes they both are same. Magento saves order in sales_order table and products of order are stored in sales_order_item and order_id in sales_order_item table connects that product to its order from sales_order table having entity_id same as order_id .

answered Jun 6, 2017 at 11:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.