search
top

Get creditcard type in Magento

Hello All, I am writing here a script snippet for getting the credit card type used in the order $order_id = 100; //order id goes here $_order = Mage::getModel('sales/order')->load($order_id); $_cctype = ''; if(!empty($_order)) { $_cctype = $_order->getPayment()->getCcTypeName(); } echo $_cctype;
read more

Get customer order count in Magento

Hello All, I am writing here a script snippet for getting the orders count for given customer < ?php $customer_id = 5; $_orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id',$customer_id); $_orderCnt = $_orders->count(); //orders count echo 'Customer with ID '.$customer_id.' has '.$_orderCnt.' orders'; ?>
read more

Order State and Status in Magento

Many of you might have come across the requirement, where they needed to change the order status dynamically. Difference between order state and status State is used by Magento to tell if the order is new, processing, complete, holded, closed, canceled etc.; while Statuses are the one that YOU would be defining at the back-end in System -> Order Statuses. Magento displays order STATUSES and not STATES...
read more

top