Wednesday, August 24, 2022
HomeWordPress Developmentplugins - Find out how to add a textual content within the...

plugins – Find out how to add a textual content within the checkout web page woocomerce?


You have got two choices. You need to use the hook woocommerce_before_thankyou hook so as to add some html earlier than “Obrigado. Seu pedido foi recebido” or you’ll be able to substitute the that thankyou textual content with any html you need with the hook woocommerce_thankyou_order_received_text

If you wish to use woocommerce_before_thankyou (NOTE: this hook will fireplace additionally on failed orders, however you’ll be able to examine contained in the hook if the order is failed with the $order_id):

operate test_hook_before_thankyou($order_id) {
    echo "teste";
}
add_action( 'woocommerce_before_thankyou', 'test_hook_before_thankyou' );

If you wish to substitute that textual content with the hook woocommerce_thankyou_order_received_text:

operate test_hook_replace_thankyou ( $thank_you_msg, $order_obj) { /* right here you have got the total order object, no solely the id */

    $thank_you_msg =  'That is your new thanks message';
    $thank_you_msg .=  '<br><b>You may add html too</b>';
    return $thank_you_msg;
}
add_filter( 'woocommerce_thankyou_order_received_text', 'test_hook_replace_thankyou' );

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments