I want to display the customer's name, location and date who bought the product previously on the product page,
can anybody tell me how to do it,
please provide me the code for the same
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI want to display the customer's name, location and date who bought the product previously on the product page,
can anybody tell me how to do it,
please provide me the code for the same
Yes for this, you will need 1. Order data
So to load order data by product,
$order = Mage::getModel('sales/order')->getCollection();
foreach($order->getAllItems() as $item){
//Here add your logic to match with your current product id
if($currentProductId == $item->getProductId()){
$customer = $order->getCustomer();
//Now you have got the customer object
//so you can fetch details which you want by your logic