选择要显示的付款图标
所有免费的 Shopify 模板都包含在页脚中显示付款图标的选项。显示的图标由商店的支付设置以及客户所在地区和所用货币决定。您可以在模板编辑器中启用付款图标。如果您想在不更改支付设置的情况下添加或删除付款图标,可以通过编辑您的模板代码来实现此目的。
在页脚中启用付款图标
此自定义设置的第一步是在页脚中启用付款图标:
转到模板编辑器。
点击页脚。
选中显示付款图标复选框。
点击保存。
编辑付款图标的代码
在此步骤中,您将更改向页脚分配付款图标的方式。默认情况下,您的模板会显示与支付网关(在后台的支付设置分区中启用)相关联且可用于当前客户所在地区和所用语言的图标。通过此自定义,您可以手动添加或删除您要显示的付款图标。
若要编辑付款图标的代码,请执行以下操作:
PC:
在 Shopify 后台中,转到在线商店 > 模板。
找到要编辑的模板,然后点击操作 > 编辑代码。
在 Sections 目录中,点击
footer.liquid
。如果您的模板中不包含此文件,则点击 Layout 目录中的theme.liquid
。
苹果系统:
在 Shopify 应用中,轻触商店。
在销售渠道部分中,轻触在线商店。
轻触 Manage themes(管理模板)。
找到要编辑的模板,然后点击操作 > 编辑代码。
在 Sections 目录中,点击
footer.liquid
。如果您的模板中不包含此文件,则点击 Layout 目录中的theme.liquid
。
安卓系统:
在 Shopify 应用中,轻触商店。
在销售渠道部分中,轻触在线商店。
轻触 Manage themes(管理模板)。
找到要编辑的模板,然后点击操作 > 编辑代码。
在 Sections 目录中,点击
footer.liquid
。如果您的模板中不包含此文件,则点击 Layout 目录中的theme.liquid
。
在该文件中查找以下代码:
{% for type in shop.enabled_payment_types %}
将其替换为:
{% assign enabled_payment_types = 'visa,master,american_express,paypal' | remove: ' ' | split: ',' %} {% for type in enabled_payment_types %}
在您刚刚粘贴的代码中,有一个用逗号分隔的支付服务提供商列表:
visa,master,american_express,paypal
。您包含在此列表中的支付服务提供商将决定在线商店上显示的付款图标。您可以根据需求编辑支付服务提供商列表。您可以使用的值如下所示:
- `afterpay` - `american_express` - `apple_pay` - `bitcoin` - `dankort` - `diners_club` - `discover` - `dogecoin` - `dwolla` - `facebook_pay` - `forbrugsforeningen` - `google_pay` - `ideal` - `jcb` - `klarna` - `klarna-pay-later` - `litecoin` - `maestro` - `master` - `paypal` - `shopify_pay` - `sofort` - `visa`
点击保存。
Shopify商户官网原文详情:
Choose which payment icons to display
All free Shopify themes include the option to display payment icons in your footer. The icons that show are determined by your store's payment settings and the customer's region and currency. You can enable payment icons in the theme editor. If you want to add or remove payment icons without changing your payment settings, then you can do so by editing your theme code.
Enable payment icons in your footer
The first step of the customization is to enable the payment icons in your footer:
Go to the theme editor.
Click Footer.
Check the Show payment icons checkbox.
Click Save.
Edit the code for your payment icons
In this step, you will change the way that payment icons are assigned to your footer. By default, your theme shows the icons that are associated with the payment gateway you have enabled in the payment settings section of your admin and that are available for the current customer's region and currency. With this customization, you will manually add or remove the payment icons that you want to display.
To edit the code for your payment icons:
PC:
From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, and then click Actions > Edit code.
In the Sections directory, click
footer.liquid
. If your theme doesn't include this file, then clicktheme.liquid
in the Layout directory.iPhone:
From the Shopify app, tap Store.
In the Sales channels section, tap Online Store.
Tap Manage themes.
Find the theme you want to edit, and then click Actions > Edit code.
In the Sections directory, click
footer.liquid
. If your theme doesn't include this file, then clicktheme.liquid
in the Layout directory.Android:
From the Shopify app, tap Store.
In the Sales channels section, tap Online Store.
Tap Manage themes.
Find the theme you want to edit, and then click Actions > Edit code.
In the Sections directory, click
footer.liquid
. If your theme doesn't include this file, then clicktheme.liquid
in the Layout directory.
Find the following code in the file:
{% for type in shop.enabled_payment_types %}Replace it with:
{% assign enabled_payment_types = 'visa,master,american_express,paypal' | remove: ' ' | split: ',' %} {% for type in enabled_payment_types %}In the code that you just pasted, there is a list of payment providers separated by commas:
visa,master,american_express,paypal
. The payment providers that you include in this list will determine which payment icons display on your online store. You can edit the list of payment providers to suit your needs.The values that you can use are listed below:
-
afterpay
-american_express
-apple_pay
-bitcoin
-dankort
-diners_club
-discover
-dogecoin
-dwolla
-facebook_pay
-forbrugsforeningen
-google_pay
-ideal
-jcb
-klarna
-klarna-pay-later
-litecoin
-maestro
-master
-paypal
-shopify_pay
-sofort
-visa
Click Save.
文章内容来源:Shopify商户官方网站