I want to show the instructions for bank transfer just like this but I don't know how to achieve that

Code: Select all
<?php
// Text
$_['text_title'] = 'Bank Transfer';
$_['text_instruction'] = 'Bank Transfer Instructions';
$_['text_description'] = 'Please transfer the total amount to the following bank account.';
$_['text_payment'] = 'Your order will not ship until we receive payment.';
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
$this->load->language('extension/payment/bank_transfer');
Code: Select all
$data['text_instruction'] = html_entity_decode( $this->language->get( 'text_instruction' ), ENT_QUOTES, 'UTF-8' );
$data['text_payment'] = html_entity_decode( $this->language->get( 'text_payment' ), ENT_QUOTES, 'UTF-8' );
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
You, of course, DO CAN add HTML to language files and you DO NOT need to add anything to controller to make it work.OSWorX wrote: ↑Thu Jan 30, 2020 8:04 pmNo matter how you do it (direct edit) or via the Language Editor, the moment you want to use some styling (e.g. HTML-Codes like b, color, etc.), this will work only if you edit the controller file (direct or as OCMod [preferred]):
catalog/controller/extension/payment/bank_transfer.php
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Oh yes, YOU can if you want.thekrotek wrote: ↑Thu Jan 30, 2020 10:37 pmYou, of course, DO CAN add HTML to language files and you DO NOT need to add anything to controller to make it work.OSWorX wrote: ↑Thu Jan 30, 2020 8:04 pmNo matter how you do it (direct edit) or via the Language Editor, the moment you want to use some styling (e.g. HTML-Codes like b, color, etc.), this will work only if you edit the controller file (direct or as OCMod [preferred]):
catalog/controller/extension/payment/bank_transfer.php
Code: Select all
This is <b>your</b> <span style="color:green">Payment Instruction</span>
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
I'm afraid, my friend, this is YOU who haven't tried it before posting, because even default OC language files have HTML in them. For example, footer.php:
Code: Select all
$_['text_powered'] = 'Powered By <a href="http://www.opencart.com">OpenCart</a><br /> %s © %s';
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Well I had, otherwise I would not post such things!thekrotek wrote: ↑Fri Jan 31, 2020 4:42 amI'm afraid, my friend, this is YOU who haven't tried it before posting, because even default OC language files have HTML in them. For example, footer.php:
So yes, it is possible to add HTML to language files. I was referring specifically to this part of your reply, where you say something about editing the controller to display HTML.Code: Select all
$_['text_powered'] = 'Powered By <a href="http://www.opencart.com">OpenCart</a><br /> %s © %s';
Is heavy midleading, because since the OC 1.4.x days the language file (translation) is loaded in the controller always byused directly into TWIG files
Code: Select all
$this->load->language('extension/payment/bank_transfer');
Code: Select all
$data = $this->load->language('extension/payment/bank_transfer');
Code: Select all
$this->load->language('extension/payment/bank_transfer');
$data['text_instruction'] = $this->language->get('text_instruction');
$data['text_description'] = $this->language->get('text_description');
$data['text_payment'] = $this->language->get('text_payment');
$data['text_loading'] = $this->language->get('text_loading');
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
What was meant by definition over there is the fact that users can directly call the language tag without the need to play with core controllers as mentioned above as well. Since that part was also mentioned, it is not misleading but rather informative.Is heavy midleading, because as the OC 1.4.x days the language file (translation) is loaded in the controller always by
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 3 guests