1

From where payment html coming inn order related template?

Code for payment HTML:

{{var payment_html|raw}}

I already checked

/vendor/magento/module-payment/view/frontend/templates/info/default.phtml

file but it is calling for the admin order only. It it not calling for the front end orders.

0

It is render from vendor/magento/module-sales/Model/Order/Email/Sender/OrderSender.php there is a function prepareTemplate

$transport = [
        'order' => $order,
        'billing' => $order->getBillingAddress(),
        'payment_html' => $this->getPaymentHtml($order),
        'store' => $order->getStore(),
        'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
        'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
    ];
4
  • But when I add {{var payment_html|raw}} this code into order-related email template then payment email is stretching into outlook mail also credit card word added into top header Can you please advise? what is the exact issue.
    – Arti patel
    Oct 16 '19 at 8:25
  • upload screenshot of email Oct 16 '19 at 9:13
  • Update the question with a screenshot. Please check.
    – Arti patel
    Oct 16 '19 at 9:50
  • Have same problem with Laybuy module. Possible Solution: Make a plugin that will truncate the string or remove it entirely.. ``` Magento_Sales/Model/Order/Email/Sender/InvoiceSender. /** * Return payment info block as html * * @param Order $order * @return string */ protected function getPaymentHtml(Order $order) { return $this->paymentHelper->getInfoBlockHtml( $order->getPayment(), $this->identityContainer->getStore()->getStoreId() ); } ``` Dec 3 '19 at 8:06
0

Have same problem with Laybuy module. Possible Solution: Make a plugin that will truncate the string or remove it entirely..

Magento_Sales/Model/Order/Email/Sender/InvoiceSender.

    /**
     * Return payment info block as html
     *
     * @param Order $order
     * @return string
     */
    protected function getPaymentHtml(Order $order)
    {
        return $this->paymentHelper->getInfoBlockHtml(
            $order->getPayment(),
            $this->identityContainer->getStore()->getStoreId()
        );
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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