[Support request] Hook on checkout page but not thank you page

Home Forums Support Hook on checkout page but not thank you page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1431209
    Sam

    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

    #1431644
    David
    Staff
    Customer Support

    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 }
    ?>
    #1435648
    Sam

    Perfect! that worked.

    #1436193
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.