Magento DB Query For Sales Product Details

Magento one of the best CMS for e-commerce website creation. Today I’m going to share some cool queries by which you will get detail of your sale product with its Increment Id, Buyer Name and  Email address.Magento DB structure is very complex, if i”m not wrong then when you install magento then you will get 250 – 270 tables in your database.  Where many tables hold your product catalog details and as like what type product and category of product and all. In magento you will get all sold product data/details in some tables and the name of those tables are

  1. sales_flat_order
  2. sales_flat_order_address
  3. sales_flat_order_grid
  4. sales_falte_order_item
  5. sales_flat_quote_item
  6. sales_flat_quote_address

Those tables hold all details of your sold product. Now it’s time of db query for get all product data from database by fire a single query.

SELECT sales_flat_order.entity_id,sales_flat_quote_address.firstname, sales_flat_quote_address.lastname,sales_flat_quote_address.email,sales_flat_order_grid.increment_id FROM sales_flat_order LEFT JOIN sales_flat_quote_address ON sales_flat_quote_address.quote_id = sales_flat_order.quote_id
LEFT JOIN sales_flat_order_grid ON sales_flat_order_grid.entity_id = sales_flat_order.entity_id WHERE sales_flat_quote_address.address_type = ['your address type'] ORDER by sales_flat_order.entity_id desc

When you fire this query in your database then you will get all sold product details with your customer number in descending form.

If you like this then share and like this on my fb page. 🙂

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Google
PC/Internet Tricks

101 Amazing PC / Internet Tricks no one told you before   You Can Search Google Timer In Google For A Timer With Alarm Search This In Google For Direct Mp3 Links intitle:index.of?mp3 Your song name here Use Your Chrome Browser As Notepad Quickly. Just copy the text below to the address Bar. …

Android
2
Animated Splash Screen to you Android App using Android Studio

Today I am switching you to one finest technology of this world and that is Android. In this tutorial I am showing you how you can create a animated Splash screen which is the first part of any android application creation.

develope
Yii2.0 Dynamic Model Creation

As per my previous shared post you have to know what is Yii 2.0 and its awesome features. If you not read these posts please read this and know little bit about Yii2.0 basic(API Web APP) . Today I am sharing you a very new feature of Yii 2.0 which will …