隐藏产品价格
您可以通过编辑货币格式来隐藏所有产品价格,并在将来再次显示价格。
提示:如果您想暂时阻止客户购买您的产品,您还可以禁用购物车。
PC:
在 Shopify 后台中,转到设置。
点击商店详细信息。
在商店货币部分,点击更改格式。
将前两个格式放在
span
元素中并将一个类设置为hidden
。请勿使用引号。例如,对于使用美元货币的商店,含货币的 HTML 格式如下:
<span class=hidden>${{ amount }} USD</span>
苹果系统:
在 Shopify 应用中,转到商店 > 设置。
在商店设置下,点击商店详细信息。
点击商店详细信息。
在商店货币部分,点击更改格式。
将前两个格式放在
span
元素中并将一个类设置为hidden
。请勿使用引号。例如,对于使用美元货币的商店,含货币的 HTML 格式如下:
<span class=hidden>${{ amount }} USD</span>
安卓系统:
在 Shopify 应用中,转到商店 > 设置。
在商店设置下,点击商店详细信息。
点击商店详细信息。
在商店货币部分,点击更改格式。
将前两个格式放在
span
元素中并将一个类设置为hidden
。请勿使用引号。例如,对于使用美元货币的商店,含货币的 HTML 格式如下:
<span class=hidden>${{ amount }} USD</span>
下方是不含货币的 HTML 格式:
<span class=hidden>${{ amount }}</span>
这应该会隐藏店面中的所有价格。如果价格仍然显示,则您需要将一些代码添加到模板样式表的底部。然后继续按照后续步骤操作。
PC:
在 Shopify 后台中,转到在线商店 > 模板。
找到要编辑的模板,然后点击操作 > 编辑代码。
苹果系统:
在 Shopify 应用中,轻触商店。
在销售渠道部分中,轻触在线商店。
轻触 Manage themes(管理模板)。
找到要编辑的模板,然后点击操作 > 编辑代码。
安卓系统:
在 Shopify 应用中,轻触商店。
在销售渠道部分中,轻触在线商店。
轻触 Manage themes(管理模板)。
找到要编辑的模板,然后点击操作 > 编辑代码。
在 Assets 目录中,点击打开
theme.scss.liquid
文件。样式表的名称可能会因模板而异,因此,如果您找不到
theme.scss.liquid
,请查找以下其中一项:
- style.scss.liquid
- styles.scss.liquid
- theme.css.liquid
- timber.scss.liquid
在文件的最底部,添加以下代码:
.hidden { display: none; }
点击保存。
当您准备好再次显示价格时,请将商店的货币更改为任何其他货币,然后再更改回您自己的货币。这会将设置恢复为您商店货币的默认货币格式,并且店面中会再次显示价格。
Shopify商户官网原文详情:
Hide product prices
You can hide all of your product prices and reveal them again in the future by editing your currency formats.
PC:
From your Shopify admin, go to Settings.
Click Store details.
In the Store currency section, click Change formatting.
Wrap the first two formats in a
span
element with a class set tohidden
. Don't use quotes. For example, below is the HTML with currency format for a store that uses USD as its currency:<span class=hidden>${{ amount }} USD</span>iPhone:
From the Shopify app, go to Store > Settings.
Under Store settings, tap Store details.
Click Store details.
In the Store currency section, click Change formatting.
Wrap the first two formats in a
span
element with a class set tohidden
. Don't use quotes. For example, below is the HTML with currency format for a store that uses USD as its currency:<span class=hidden>${{ amount }} USD</span>Android:
From the Shopify app, go to Store > Settings.
Under Store settings, tap Store details.
Click Store details.
In the Store currency section, click Change formatting.
Wrap the first two formats in a
span
element with a class set tohidden
. Don't use quotes. For example, below is the HTML with currency format for a store that uses USD as its currency:<span class=hidden>${{ amount }} USD</span>Below is the HTML without currency format:
<span class=hidden>${{ amount }}</span>This should hide all the prices on your storefront. If prices are still showing, then you need to add some code to the bottom of your theme's stylesheet. Continue to follow the next steps.
PC:
From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, and then click Actions > Edit code.
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.
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 Assets directory, click to open your
theme.scss.liquid
file.The name of the stylesheet can vary theme to theme, so if you cannot find
theme.scss.liquid
, look for one of the following:
style.scss.liquid
styles.scss.liquid
theme.css.liquid
timber.scss.liquid
At the very bottom of the file, add the following code:
.hidden { display: none; }Click Save.
When you are ready to show your prices again, change your shop's currency to any other one, then change it back to your own currency. This reverts your settings to the default money formats for your shop's currency and shows the prices in your storefront again.
文章内容来源:Shopify商户官方网站