Question:Which of the following will check whether the currently logged-in customer ever placed an order at the Magento store? 

A $order = Mage::getModel('sales/order')->getCollection() ->addAttributeToFilter('customer_id',$session->getId()) ->getFirstItem(); if ($orders->getSizeValue()) { } 

B $orders = Mage::getResourceModel('sales/order_collection') ->addFieldToSelect('*') ->addFieldToFilter('entity_id', $customer->getEntityId()); if ($orders->getSize()) { } 

C $orders = Mage::getResourceModel('sales/order_collection') ->addFieldToFilter('customer_id', $customer->getId()); if ($orders->getValue()) { } 

D $orders = Mage::getResourceModel('sales/order_collection') ->addFieldToSelect('*') ->addFieldToFilter('customer_id', $customer->getId()); if ($orders->getSize()) { } 

+ Answer
+ Report
Total Preview: 860

Copyright © 2024. Powered by Intellect Software Ltd