1

I'm writing my own function for sending emails. In the Magento email template, there's a variable {{var payment_html}} which I need to convert to $order object. The question is how can I get the content of payment_html from $order object?

1 Answer 1

2

You cannot the payment html directly form the order because there is a block involved.
You can generate the html like this:
Let's say $order is your order object.

$paymentBlock = Mage::helper('payment')->getInfoBlock($order->getPayment())
                ->setIsSecureMode(true);
$paymentBlock->getMethod()->setStore($order->getStoreId());
$paymentBlockHtml = $paymentBlock->toHtml();

BUt if you want you can attache the payment html to the order object after generating it.

$order->setPaymentHtml($paymentBlockHtml);

and you can read it from the order object after that with

$order->getPaymentHtml();
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.