How can I display custom wording on my checkout review step?

Hi there,

I’m trying to get some wording to appear on the ‘Review’ step of my site’s checkout pages.

I’ve followed the instructions at this link - https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/show-content-based-….

My code reads as follows:

{% if checkout.shipping_address.country_code == ‘IE’ and checkout.shipping_address.county_code == ‘KY’ %}

{% endif %}

NB: the country code IE for Ireland and county code KY for Kerry are correct as far as I’m aware.

The instructions at the Shopify Help Center link above had checkout.shipping_address.province_code, which I changed to checkout.shipping_address.county_code, because, well, I thought I had to…

My code is pasted into the relevant box under Order processing > Additional scripts in my store’s Checkout settings.

But alas, I cannot see the wording on the Checkout ‘Review’ page. I’ve tried it with province_code and county_code.

Help please?!

Hi DigitalStuart, I think we have the same problem here.

Do you see this error in the browser dev tool (console)?

Cubbit_1-1612781295536.png

As far I have understood, the country gets correctly recognized and the script is loaded, the problem is that the script runs before the order page DOM is loaded, and therefore it can’t find any element to attach the custom message to.

The behavior is replicable with this example script: https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/show-content-based-on-location.

I have also tried to use onload events but apparently, they won’t get triggered.