I have a Magento 1.9 site with 2 stores. Both stores have different root categories.

Products of both categories are shared between both stores.

When a customer made a purchase, is there a way to know which store he bought the product from?

Thanks Jaime


The tables sales_flat_order has a column store_id where Magento saves the information you need.

So you have many ways to get that information. For example if you have a Mage_Sales_Model_Order $order object you can simply call $order->getStoreId() to get the store id for that specific order.

If you want to get the information from the database just use

select store_id from sales_flat_order where [put your condition here];

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.