Get users who has bought this product (MAGENTO)

前端 未结 3 1309

Is it possible in magento to filter user based on the products they have bought? For eg.

How can I get all the users who have bought product A from category B

<
3条回答
  •  隐瞒了意图╮
    2020-12-14 13:16

    try these models

    $orders = Mage::getModel('sales/order')->addAttributeToSelect('*')->getCollection();
    
    $order_items = Mage::getResourceModel('sales/order_item_collection')
    ->addAttributeToSelect('sku')
    ->addAttributeToSelect('created_at')
    ->addAttributeToSelect('order_id')
    ->addAttributeToFilter('order_id', array('in' => $orders_ids))->load();
    

提交回复
热议问题