Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

database question
 
honeyharish
Member
 
Total Posts:  60
Joined:  2008-07-10
 

can any one tell the proper tables where is can relate customer with there buying products
(i found sales_order where i can find orders), but i am not able to find which customer place that order
please some one give some light on customer id, product id, order id relationship

thanks in advance
smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

In sales_order you have and attribute call : customer_id
If you want the product of an order look : sales_flat_order_item : sales_order.entoty_id = sales_flat_order_item.order_id

Maybe this will help you : http://www.magentocommerce.com/wiki/magento_database_diagram

 
Magento Community Magento Community
Magento Community
Magento Community
 
honeyharish
Member
 
Total Posts:  60
Joined:  2008-07-10
 

hi
thanks a lot nicolas46
u saved my lyf smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
honeyharish
Member
 
Total Posts:  60
Joined:  2008-07-10
 

one more thing

i am useing 1.0 version and there is no table sales_flat_order_item :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

Access to order Item

Using php :

$collectionCMD Mage::getResourceModel('sales/order_collection')        
                        ->
addAttributeToSelect('*');

foreach (
$collectionCMD as $order){        
                        $items
=$order->getItemsCollection();                                                   
                    foreach (
$items as $item){    
                          
...
                        
}
...
}

Directly in database (1.0) (i’m not 100% sure)

Look the table sales_order_entity (where entity_type_id = 13)

Directly in database (1.1)

Look in sales_flat_order_item

 
Magento Community Magento Community
Magento Community
Magento Community
 
honeyharish
Member
 
Total Posts:  60
Joined:  2008-07-10
 

thanks dear
now i have downloaded 1.1.1 version
and i found that table
thanks again

 
Magento Community Magento Community
Magento Community
Magento Community
 
ggoodwin
Member
 
Avatar
Total Posts:  38
Joined:  2008-02-19
Colorado - USA
 

The location for the Magento database diagram refered to in an earlier post has changed.  The current diagram links are:
* Database Diagram FORUM
* Database Diagram WIKI

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top