fahimmurshed

Customizing WooCommerce Thank You page with Filters

May 16th, 2021
745
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter( 'the_title', 'woo_title_order_received', 10, 2 );
  2.  
  3. function woo_title_order_received( $title, $id ) {
  4.     if ( function_exists( 'is_order_received_page' ) &&
  5.          is_order_received_page() && get_the_ID() === $id ) {
  6.         $title = "Thank you for your order! :)";
  7.     }
  8.     return $title;
  9. }
  10.  
  11. add_filter( 'woocommerce_thankyou_order_received_text', 'fahim_thank_you_title', 20, 2 );
  12.  
  13. function fahim_thank_you_title( $thank_you_title, $order ){
  14.  
  15.     return 'Oh ' . $order->get_billing_first_name() . ', thank you so much for your order!';
  16.  
  17. }
  18.  
  19. # https://www.tychesoftwares.com/how-to-customize-the-woocommerce-thank-you-page/
  20. # https://rudrastyh.com/woocommerce/thank-you-page.html
RAW Paste Data