这段代码在 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\'';
关于php - 2.3 中的相同代码不适用于 Magento 2.3.3 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60772264/