- Magento 1 version : 1.9.4.0
- Magento 2 version : 2.3.5
- Fresh install of m2
- Run migrate:settings
- Run migrate:data All data is migrated
We migrated data successfully but getting issues of html tags on invoice pages. Admin->Sales->Invoices->Click on any invoice->Invoice page will open "Payment Information" under "Payment & Shipping Method" head here Data(content or description) showing in html tags.
Expected result
Data must be show WITHOUT HTML tags
Actual result
But here data is showing WITH HTML tags
I just changed vendor/magento/module-sales/view/adminhtml/templates/order/invoice/view/form.phtml
before - <?= $block->getChildHtml('order_payment') ?>
now i using escaper function like this -
$data = $block->getChildHtml('order_payment');
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
echo $escaper = $objectManager->create('Magento\Framework\Escaper')->escapeHtml($data);
Sample data(which i get on $data) -
<p>Western Union</p> <table> <tbody> <tr> <td><p><strong>WU Instructions: </strong>Western Union is a common way for people to send any currency to the USA. For Western Union you can either use their website, or go to a nearby Western Union store. Once you do this, email us back the information.</p><p>To find your nearest location, go to:<br><a href="http://locations.westernunion.com/" target="_blank">locations.westernunion.com</a><p>Bring your invoice, and this information with you to the Western Union store. This is the "Receiver" information: </p><p>* Name: <strong>john cloe </strong><br>* Street: <strong>123 b 108th mw</strong><br>* City, State & Zip: <strong>Seattle, Washington State, 98121</strong><br>* Country: <strong>USA </strong><br>* Phone: <strong>123-456-7890 </strong></p><p>When the money is sent, email us back: WU Control number; Senders full name, Senders City, State, and Country. That is it.</p></td> </tr> </tbody> </table>
but still not working
Section -
<div class="admin__page-section-item order-payment-method<?php if ($_order->getIsVirtual()) : ?> order-payment-method-virtual<?php endif; ?> admin__fieldset-wrapper">
<?php /*Billing Address */ ?>
<div class="admin__page-section-item-title">
<span class="title"><?= $block->escapeHtml(__('Payment Information')) ?></span>
</div>
<div class="admin__page-section-item-content">
<div class="order-payment-method-title">
<?php
$data = $block->getChildHtml('order_payment');
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$allowableTags="<a>";
$result = strip_tags($data, $allowableTags);
echo $escaper = $objectManager->create('Magento\Framework\Escaper')->escapeHtml($result, $allowableTags);
?>
</div>
<div class="order-payment-currency">
<?= $block->escapeHtml(__('The order was placed using %1.', $_order->getOrderCurrencyCode())) ?>
</div>
<div class="order-payment-additional"><?= $block->getChildHtml('order_payment_additional') ?></div>
</div>
</div>
How to remove this HTML tags ?
form.phtml
file copy and paste your migrate magento folder.i think you are understand