Show content based on shipping method
This page was printed on Mar 29, 2023. For the current version, visit https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/show-content-based-on-shipping-method.
Learn how to use a conditional with the variable checkout.shipping_method.title
.
For example, you might have a local pickup option for customers who live close enough to your brick and mortar store. You can give them the retail address of your store on the order status page if they select the "local pickup option".
Steps:
- From your Shopify admin, go to Settings > Checkout.
- From the Shopify app, go to Store > Settings.
- Under Store settings, tap Checkout.
- From the Shopify app, go to Store > Settings.
- Under Store settings, tap Checkout.
Scroll down to the Additional scripts section.
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'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>
Paste the code into the Additional scripts box. (
command + v
on a Mac,ctrl + v
on a PC)Complete a test order to view your order status page.