Skip to content
Advertisement

How to target all pages except WooCommerce Thankyou page

I have a hook that looks like this:

JavaScript

This works well, however I now need the opposite. All pages that don’t use this hook…

Can I embed the above into an IF statement and then use the ELSE statement to resolve?

Advertisement

Answer

As the hook woocommerce_thankyou is triggered in WooCommerce “Order received” page, To target all pages except WooCommerce Thankyou “Order received” page, You will use the following condition inside any function or template:

JavaScript

So to target “Order received” Thankyou page you will use:

JavaScript

Related: WooCommerce Conditional Tags

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement