I need to add some content to the Wooommerce thankyou.php. In the past, I had added it by overriding it in the child theme, but this is not an option any longer so I need to add the content through an action hook somehow. How can I do this? The content I need to add is
<div class ="text"><p>Lorem ipsum <strong><?php echo $order->get_order_number(); ?></strong>.</p>
<h3>
Headline
</h3>
<?php if ( 'paypal' == $order->get_payment_method() ){
printf( __("<p>Lorem ipsum <strong>%s</strong>.</p>", "woocommerce"), $order->get_billing_email() );
}
else {printf( __("<p>Lorem ipsum 2 <strong>%s</strong>.</p>", "woocommerce"), $order->get_billing_email() );
} ?>
<h3>
Headline
</h3>
<p>
Lorem ipsum
</p>
</div>
How can I add this content to the thankyou.php and remove the default "Thank you, your order has been received" sentence plus order overview table at the top?
2
Answers
Havent tried it, but this might work:
You can use woocommerce action hooks woocommerce_thankyou_. For further information on how to use it you can view this link. Hope it helps 🙂
https://www.webroomtech.com/add-custom-content-to-woocommerce-thank-you-page/