How To Add Content To The Thank You Page in WooCommerce?

A customer of mine needed to add some content to the thank you page, the page that clients see after they put in a request on WooCommerce. For her situation, she needed to include an exceptional idea so as to lure purchasers to return to the site and purchase once more.

1. Add content to the WooCommerce in thank you page.

[php]

add_action( ‘woocommerce_thankyou’, ‘wbcomdesign_add_content_thankyou’ );

function wbcomdesign_add_content_thankyou() {
echo ‘<h2 class="wbcomthanks">Get 50% off</h2><p class="pthanks">Thank you for making this purchase! Come back and use the code "<strong>wbcom5n</strong>" to receive a 50% discount on your next purchase!</p>’;
}

[/php]

2. Add content to the WooCommerce in thank you page IF payment method is PayPal.

[php]

add_action( ‘woocommerce_thankyou_paypal’, ‘wbcomdesign_add_content_thankyou_paypal’ );

function wbcomdesign_add_content_thankyou_paypal() {
echo ‘<h2 class="wbcomthanks">Get 50% off</h2><p class="pthanks">Thank you for making this purchase via PayPal! Come back and use the code "<strong>wbcom5n</strong>" to receive a 50% discount on your next PayPal purchase!</p>’;
}

[/php]

2. Add content to the WooCommerce in thank you page IF payment method is PayPal.

[php]

add_action( ‘woocommerce_thankyou_paypal’, ‘wbcomdesign_add_content_thankyou_paypal’ );

function wbcomdesign_add_content_thankyou_paypal() {
echo ‘<h2 class="wbcomthanks">Get 50% off</h2><p class="pthanks">Thank you for making this purchase via PayPal! Come back and use the code "<strong>wbcom5n</strong>" to receive a 50% discount on your next PayPal purchase!</p>’;
}

[/php]

 

Leave a Reply

Your email address will not be published. Required fields are marked *