简体   繁体   English

将购物车页面上的更新按钮从输入转换为Shopify中的锚链接

[英]Convert update button on cart page from input to an anchor link in Shopify

On the cart page in Shopify I'd like to use an anchor link instead of an input button when user updates cart so that I can add an html icon using Font Awesome. 在Shopify的购物车页面上,当用户更新购物车时,我想使用锚链接而不是输入按钮,以便可以使用Font Awesome添加html图标。 I don't believe I can accomplish with a button. 我不相信一个按钮就能完成。

Here's the current button: 这是当前按钮:

<input type="submit" id="update-cart" class="btn" name="update" value="{{ 'cart.general.update' | t }}" style="float:right;"/>

I tried the following with no luck: 我没有运气就尝试了以下方法:

<a href="#" id="update-cart">Update <i class='fa fa-refresh' aria-hidden='true'></i></a>

A button would definitely be the best solution here. 一个button肯定是这里最好的解决方案。 I'm not sure why you believe it wouldn't work. 我不确定为什么您会认为它行不通。 Try this: 尝试这个:

<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>

Note that you should really add that inline style via a rule in an external stylesheet. 请注意,您实际上应该通过外部样式表中的规则添加该内联样式。

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

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