dvs.spy
dvs.spy

Reputation: 65

Woocommerce, How to check current page is order tracking page?

I am working on Woocommerce and want to trigger some code on Order Tracking page only. Is there any function like is_cart() or is_shop() to check that the current page is Order Tracking Page or not?

My code snippet to identify other Woocommerce page is similar as below :

if(is_woocommerce() || is_cart() || is_checkout() || is_account_page()){

      //do this things..

}

if( *order-tracking-page* ){

     // do this things

}

Please let me know if there is any method or function to identify the current page is order tracking page.

Upvotes: 2

Views: 3915

Answers (1)

Maha Dev
Maha Dev

Reputation: 3965

There isn't any built-in function to identify the order tracking page. you can use wordpress global variable '$pagename' that contains always the page name in which you are. So try this , it might help you. Like:

if($pagename == 'your-page-name'){
   // do what you want here.
}

Upvotes: 0

Related Questions