Site logo

Archived topic

Hook on checkout page but not thank you page

3 replies · Started by Sam on September 4, 2020

Viewing posts 1–4 of 4

Hello, I have a hook that ads some HTML to the checkout page before content, but I notice it is also present on the thank you page when an order is placed. Is there any way to not display it on the thank you page? I cannot see this page time in the exclusion list... I guess it is kind of still the checkout page.

Any suggestions welcomed?

thanks
Sam

Hi there,

Try wrapping your code in the following PHP Snippet:

<?php
if ( ! is_wc_endpoint_url('order-received') ) { ?>
    // Do stuff here on checkout but not on order received.
<?php }
?>

Perfect! that worked.

Glad to be of help

This archived topic is closed to new replies.