将购物车页面上的更新按钮从输入转换为 Shopify 中的锚 link
Convert update button on cart page from input to an anchor link in Shopify
在 Shopify 的购物车页面上,我想在用户更新购物车时使用锚 link 而不是输入按钮,这样我就可以使用 Font Awesome 添加 html 图标。我不相信我可以用一个按钮完成。
这是当前按钮:
<input type="submit" id="update-cart" class="btn" name="update" value="{{ 'cart.general.update' | t }}" style="float:right;"/>
我尝试了以下但没有成功:
<a href="#" id="update-cart">Update <i class='fa fa-refresh' aria-hidden='true'></i></a>
A button
绝对是这里最好的解决方案。我不确定您为什么认为它行不通。试试这个:
<button id="update-cart" class="btn" name="update" style="float: right;">
{{ 'cart.general.update' | t }}
<i class="fa fa-refresh" aria-hidden="true"></i>
</button>
请注意,您确实应该通过外部样式表中的规则添加该内联样式。
在 Shopify 的购物车页面上,我想在用户更新购物车时使用锚 link 而不是输入按钮,这样我就可以使用 Font Awesome 添加 html 图标。我不相信我可以用一个按钮完成。
这是当前按钮:
<input type="submit" id="update-cart" class="btn" name="update" value="{{ 'cart.general.update' | t }}" style="float:right;"/>
我尝试了以下但没有成功:
<a href="#" id="update-cart">Update <i class='fa fa-refresh' aria-hidden='true'></i></a>
A button
绝对是这里最好的解决方案。我不确定您为什么认为它行不通。试试这个:
<button id="update-cart" class="btn" name="update" style="float: right;">
{{ 'cart.general.update' | t }}
<i class="fa fa-refresh" aria-hidden="true"></i>
</button>
请注意,您确实应该通过外部样式表中的规则添加该内联样式。