繁体   English   中英

2.3 中的相同代码不适用于 Magento 2.3.3 版本

[英]Same code in 2.3 is not working with Magento 2.3.3 version

这是代码在 Magento 2.3 上工作正常,但在 2.3.3 上不工作

数据.php

<?php
namespace Namespace\Module\Plugin\Search\Helper;
use Magento\Search\Model\QueryFactory;

class Data {

    protected $dataHelper;

    protected $view;

    public function __construct(
        \Namespace\Module\Helper\Data $helper,
        \Magento\Framework\App\View $view
    ) {
        $this->dataHelper = $helper;
        $this->view = $view;
    }

    public function afterGetEscapedQueryText(
        \Magento\Search\Helper\Data $subject,
        $result
    ) {
        $return = '';
        if(QueryFactory::QUERY_VAR_NAME == "q") {  
            $return = " data-id='exampleid_p1'";
        }

        return $result . $return;
    }
}

前端问题的屏幕截图。 在此处输入图片说明

我开始面临这个问题的 Magento 2.3.3 有什么变化?

如果您将其更改为:

$return = ' data-id=\'exampleid_p1\'';

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM