根据发货方式显示内容

了解如何使用带有变量 checkout.shipping_method.title 的条件。

例如,您可以为离您的实体店足够近的客户提供到店取货选项。如果客户选择“到店取货选项”,您可以在订单状态页面上向他们提供商店的零售店地址。

步骤:

  1. 向下滚动至自定义脚本部分。

  2. 将以下代码复制到剪贴板(在 Mac 上为 command + c,在 PC 上为 ctrl + c)。

  <script>
    // DEBUG {{ checkout.shipping_method.title }} has been used
    {% if checkout.shipping_method.title == 'Pick-up at the store' %}
      Shopify.Checkout.OrderStatus.addContentBox(
        `<p>Okay, we're ready for you to collect your products from 17 Mapple Crescent, Toronto. Our store is open 9:00 to 5:00 every day.</p>`
      )
    {% endif %}
  </script>
  1. 将代码粘贴到自定义脚本框中。(Mac 上为 command + v,PC 上为 ctrl + v

  2. 完成测试订单以查看您的订单状态页面。

准备好开始使用 Shopify 进行销售了吗?

免费试用