我们正在使用 Shopify,我们有一个发票页面,其中显示了产品名称和其他数据。
我的问题是 product.title<br>在发票页面上显示标签。
(在产品页面标题上显示无<br>标签)
这样做的原因是product.title只能通过 WYSIWYG 输入。
其中 WYSIWYG 编码product.title为 ASCII 码并product.title在发票页面上解码。
我正在尝试使用带有语句的Liquid 字符串过滤器查找和替换/隐藏<br>标签,但它不起作用。如果我将更改为代码将用空格替换Dress。
请在下面找到我的代码的一部分。product.title
{{ product.title | replace: 'Awesome', 'Mega' }}{% if %}{% if line.title contains '<br>'%}{% if line.title contains 'Dress'%}
我添加的部分代码
{% if line.title contains '<br>'%} {{ line.title | replace: '<br>', ' ' }} {% endif %}
Run Code Online (Sandbox Code Playgroud)
通用代码
<td class="order-list__product-description-cell" style="width:100%">
{% if line.product.title %} {% assign line_title = …Run Code Online (Sandbox Code Playgroud)