Fix HTML rendering for vendor notes links

Add proper HTML filtering to render mailto links and formatting in vendor notes.

- Create HtmlArraySerialized backend model to prevent HTML escaping
- Add filterOutputHtml() method to safely render HTML content
- Update template to use HTML filtering
- Decode HTML entities before display
This commit is contained in:
shopkeeperdev
2025-10-07 19:03:16 -04:00
parent fcc8697c75
commit 9d6112b703
4 changed files with 39 additions and 3 deletions

View File

@@ -6,23 +6,27 @@ use Magento\Sales\Model\Order;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\Filter\Template as FilterTemplate;
class VendorNotes extends Template
{
protected $_order;
protected $_scopeConfig;
protected $json;
protected $filterTemplate;
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Sales\Model\Order $order,
ScopeConfigInterface $scopeConfig,
Json $json,
FilterTemplate $filterTemplate,
array $data = []
) {
$this->_order = $order;
$this->_scopeConfig = $scopeConfig;
$this->json = $json;
$this->filterTemplate = $filterTemplate;
parent::__construct($context, $data);
}