Print Order receipt on thank you page
-
Hi there,
I’m trying to add in a button on the ‘Thank You’ page that will allow the user to print their invoice. I used the code below but every time I save the theme it strips the onclick=”window.print()” from the code.
How could I achieve this?
<p>[vc_row gap=”35″ mobile_bg_img_hidden=”no” tablet_bg_img_hidden=”no” woodmart_parallax=”0″ woodmart_gradient_switch=”no” row_reverse_mobile=”0″ row_reverse_tablet=”0″ woodmart_disable_overflow=”0″][vc_column width=”1/6″][/vc_column][vc_column width=”1/6″][/vc_column][vc_column width=”1/6″][vc_column_text]<button style=”color: #5e5e5e; border-color: #ececec; background-color: #ececec; border-radius: 5px; padding: 15px;” onclick=”window.print()”>Print this page</button>[/vc_column_text][/vc_column][vc_column width=”1/6″][vc_btn title=”MY ACCOUNT” link=”url:https%3A%2F%2Fstaging.bushido.ca%2Fmy-account%2F|title:My%20Account||”][/vc_column][vc_column width=”1/6″][/vc_column][vc_column width=”1/6″][/vc_column][/vc_row]</p>
Hi,
Sorry, but there is no such option in our theme and WooCommerce by default. It may require additional code customization or extra plugin but we don’t have an instruction for this. It is out of our theme support scope.
Regards
So I added it to a page and it worked great!
Just not on that thank you page? Is there anyway you could help?
If you mean that you want to add it on the Thank you page then you can find the code for this page in the file woodmart/woocommerce/checkout/thankyou.php.
Kind Regards
Can I ask what script I would use to add it to a button on the thank you page. Every single option I have tried gets stripped or removed.
Sorry, but we don’t have such scripts that should help you. If you want to add a simple button then you can use the following HTML for example
<a href="#" class="btn btn-color-primary">Read More</a>