shopify商店隐藏产品价格步骤 shopify模板编辑教程

2024-01-01 14:01:26
By 瘠薄狗友

隐藏产品价格



您可以通过编辑货币格式来隐藏所有产品价格,并在将来再次显示价格。

提示:如果您想暂时阻止客户购买您的产品,您还可以禁用购物车。

PC:

  1. 在 Shopify 后台中,转到设置

  1. 点击商店详细信息

  2. 商店货币部分,点击更改格式

  3. 将前两个格式放在 span 元素中并将一个类设置为 hidden。请勿使用引号。例如,对于使用美元货币的商店,含货币的 HTML 格式如下:

<span class=hidden>${{ amount }} USD</span>

苹果系统:

  1. 在 Shopify 应用中,转到商店 > 设置

  2. 商店设置下,点击商店详细信息

  1. 点击商店详细信息

  2. 商店货币部分,点击更改格式

  3. 将前两个格式放在 span 元素中并将一个类设置为 hidden。请勿使用引号。例如,对于使用美元货币的商店,含货币的 HTML 格式如下:

<span class=hidden>${{ amount }} USD</span>

安卓系统:

  1. 在 Shopify 应用中,转到商店 > 设置

  2. 商店设置下,点击商店详细信息

  1. 点击商店详细信息

  2. 商店货币部分,点击更改格式

  3. 将前两个格式放在 span 元素中并将一个类设置为 hidden。请勿使用引号。例如,对于使用美元货币的商店,含货币的 HTML 格式如下:

<span class=hidden>${{ amount }} USD</span>

下方是不含货币的 HTML 格式:

<span class=hidden>${{ amount }}</span>



这应该会隐藏店面中的所有价格。如果价格仍然显示,则您需要将一些代码添加到模板样式表的底部。然后继续按照后续步骤操作。

PC:

  1. 在 Shopify 后台中,转到在线商店 > 模板

  2. 找到要编辑的模板,然后点击操作 > 编辑代码

苹果系统:

  1. 在 Shopify 应用中,轻触商店

  2. 销售渠道部分中,轻触在线商店

  3. 轻触 Manage themes(管理模板)。

  4. 找到要编辑的模板,然后点击操作 > 编辑代码

安卓系统:

  1. 在 Shopify 应用中,轻触商店

  2. 销售渠道部分中,轻触在线商店

  3. 轻触 Manage themes(管理模板)。

  4. 找到要编辑的模板,然后点击操作 > 编辑代码

  1. 在 Assets 目录中,点击打开 theme.scss.liquid 文件。

    样式表的名称可能会因模板而异,因此,如果您找不到 theme.scss.liquid,请查找以下其中一项:

style.scss.liquid - styles.scss.liquid - theme.css.liquid - timber.scss.liquid

  1. 在文件的最底部,添加以下代码:

.hidden {   display: none; }
  1. 点击保存

当您准备好再次显示价格时,请将商店的货币更改为任何其他货币,然后再更改回您自己的货币。这会将设置恢复为您商店货币的默认货币格式,并且店面中会再次显示价格。

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:

  1. From your Shopify admin, go to Settings.

  1. Click Store details.

  2. In the Store currency section, click Change formatting.

  3. Wrap the first two formats in a span element with a class set to hidden. 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:

  1. From the Shopify app, go to Store > Settings.

  2. Under Store settings, tap Store details.

  1. Click Store details.

  2. In the Store currency section, click Change formatting.

  3. Wrap the first two formats in a span element with a class set to hidden. 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:

  1. From the Shopify app, go to Store > Settings.

  2. Under Store settings, tap Store details.

  1. Click Store details.

  2. In the Store currency section, click Change formatting.

  3. Wrap the first two formats in a span element with a class set to hidden. 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:

  1. From your Shopify admin, go to Online Store > Themes.

  2. Find the theme you want to edit, and then click Actions > Edit code.

iPhone:

  1. From the Shopify app, tap Store.

  2. In the Sales channels section, tap Online Store.

  3. Tap Manage themes.

  4. Find the theme you want to edit, and then click Actions > Edit code.

Android:

  1. From the Shopify app, tap Store.

  2. In the Sales channels section, tap Online Store.

  3. Tap Manage themes.

  4. Find the theme you want to edit, and then click Actions > Edit code.

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

  2. At the very bottom of the file, add the following code:

    .hidden {   display: none; }
  3. 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商户官方网站



(本文内容根据网络资料整理和来自用户投稿,出于传递更多信息之目的,不代表本站其观点和立场。本站不具备任何原创保护和所有权,也不对其真实性、可靠性承担任何法律责任,特此声明!)


常见问答(FQAS)


如何隐藏商店所有产品的价格?

登录到你的Shopify管理面板,选择\"商品\"选项,点击\"编辑主题\",找到products.liquid文件,在products标签内添加display: none;

如何只隐藏部分产品的价格?

你可以为需要隐藏价格的产品设置一个特殊的标签,然后在products.liquid文件中添加以下liquid代码来隐藏带有这个标签的产品价格:

{% if product.tags contains 'hide_price' %} {% endif %} 如何在商店模板中添加和编辑代码?

登录到你的Shopify管理面板,选择\"自定义ization\"下的\"模板\",选择需要编辑的模板文件(如products.liquid),这里你可以添加和编辑HTML/Liquid代码。修改保存后,修改即时生效。

如果价格隐藏后,如何让客户能查看价格?

你可以添加一个\"询问价格\"按钮,点击后弹出产品价格。具体方法是在模板文件中添加以下代码:

{% if product.tags contains 'hide_price' %} {% endif %}