Show content based on shipping method

This will show you how to use a conditional with the variable checkout.shipping_method.title.

For example, John has a local pickup option for customers who live close enough to his brick and mortar store, and wants to give them the retail address on the order status page, but only if they select the "local pickup option".

Steps:

  1. Scroll down to the Additional scripts section.

  2. Copy the following code to your clipboard (command + c on a Mac, ctrl + c on a PC).

  <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 are waiting for you to come and get your stuff, our brick and
         mortar is open 9 to 5 and our address is 14 Diagon Alley (three up and
         two across from the trash can).</p>`
      )
    {% endif %}
  </script>
  1. Paste the code into the Additional scripts box. (command + v on a Mac, ctrl + v on a PC)

  2. Complete a test order to view your order status page:

Shopify - order status thank you

Ready to start selling with Shopify?

Try it free