How to Allow HTML Code in Bank Transfer Info for OpenCart

How to Allow HTML Code in Bank Transfer Info for OpenCart

OpenCart is a popular open-source e-commerce platform that allows you to set up and manage an online store. While it has many useful features, it can sometimes be challenging to customize the platform to fit your needs. One issue you may encounter is the inability to display HTML code in the bank transfer information section. This can be frustrating if you need to add special formatting or images to your bank transfer information. However, with a few simple steps, you can resolve this issue.

The first step is to open the file catalog/controller/extension/payment/bank_transfer.php. This is where the code that displays the bank transfer information is located. Next, find the text:

$data[‘bank’] = nl2br($this->config->get(‘payment_bank_transfer_bank’ . $this->config->get(‘config_language_id’)));

To allow HTML code in the bank transfer information, replace this line of code with the following:

$data[‘bank’] = html_entity_decode($this->config->get(‘payment_bank_transfer_bank’ . $this->config->get(‘config_language_id’)));

Next, open the file catalog/controller/account/order.php and find the text:

$data[‘comment’] = nl2br($order_info[‘comment’]);

And replace it with the following code:

$data[‘comment’] = html_entity_decode($order_info[‘comment’]);

Then, find the text:

‘comment’ => $result[‘notify’] ? nl2br($result[‘comment’]) : ”

And replace it with:

‘comment’ => $result[‘notify’] ? html_entity_decode($result[‘comment’]) : ”

Finally, open the file admin/controller/sale/order.php and find the text:

$data[‘comment’] = nl2br($order_info[‘comment’]);

And replace it with:

$data[‘comment’] = html_entity_decode($order_info[‘comment’]);

Then, find the text:

‘comment’ => nl2br($result[‘comment’]),

And replace it with:

‘comment’ => html_entity_decode($result[‘comment’]),

Finally, find the text:

‘comment’ => nl2br($order_info[‘comment’])

And replace it with:

‘comment’ => html_entity_decode($order_info[‘comment’])

These changes will allow you to display HTML code in the bank transfer information section of your OpenCart store. With a few simple modifications, you can customize your store to meet your specific needs and provide a better shopping experience for your customers.

Leave a Reply

Vaša e-mailová adresa nebude zverejnená. Vyžadované polia sú označené *

Táto webová stránka používa Akismet na redukciu spamu. Získajte viac informácií o tom, ako sú vaše údaje z komentárov spracovávané.