Please, explain, how can I check if order paid by (credit/debit) card?
I need to check if order paid by card in observer. I know only order id.
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 communityPlease, explain, how can I check if order paid by (credit/debit) card?
I need to check if order paid by card in observer. I know only order id.
To get the payment method title by order id
$order = Mage::getModel('sales/order')->load(24999); // your order entity_id
$order = Mage::getModel('sales/order')->loadByIncrementId('10000001'); // increment id
echo $method = $order->getPayment()->getMethodInstance()->getTitle();
now the $method
will return payment method title. So you can do your logic with this.
As @Marius comment
$method = $order->getPayment()->getMethodInstance()->getCode();
The payment method code will not change for each store view. So better you could use method code.
$method = $order->getPayment()->getMethodInstance()->getCode();
since the code never changes but the title can be changed for each store view. Other than that...good stuff.