Redirect to a Custom Thank You Page After Checkout in WooCommerce Without Any Plugins

preview_player
Показать описание
The function required to do this is pinned 📌 to the top comment.

What I use to build amazing websites:

After your customers purchase something in WooCommerce, they're redirected to a very basic, very unappealing thank you page. There's a very easy way to fix that and to redirect them to any page on your website you wish to, without using any additional plugins. It's a great way to add some personality to your website and to improve your customers' experience.

Make sure you use a child theme and back up your WordPress website before doing this!
#WooCommerce #checkout #redirect

Get in touch:

Don’t be shy! Let me know what you’d like to see next, ask me anything related to design or just simply say hi.

Please note that some of the above are affiliate links, which means I earn a commission if you make a purchase, at no additional cost to you. Thank you very much if you decide to use them!
Рекомендации по теме
Комментарии
Автор

Relevant videos:

The function required to do this 👇

/**
* Redirect WooCommerce to a custom page after checkout
*/
add_action( 'woocommerce_thankyou',
function $order_id ){
$order = wc_get_order( $order_id );
$url = 'your URL here';
if ( ! $order->has_status( 'failed' ) ) {
wp_safe_redirect( $url );
exit;
}
}

Reialesa
Автор

Your channel is hugely undervalued. Quality is really good bro

davis.
Автор

But how to add things like "order details" in the custom made page?

niffostudios
Автор

Update: Now I got it to work. First I tried to redirect to a different website and it did not work. Now I set up a redirection to the same website and it worked. Thanks again!

naomikoopmans
Автор

How do I display the customers order number on the thank you page?

paulwhitehead
Автор

I don't have Appearance - Theme File Editor. I tryed it with Code Snippets but it dosn't work there.

kairimae
Автор

This is whwt im looking for but after your instructions are followed and tested, it takes me to woocomerce log in page

deltasignshop
Автор

I have downloadable products and it doesn't seem to work in my case. Any insight?

artistdigital
Автор

I am trying to add custom cta on the top of checkout page, did everything but still nothing works. Need help!

AraibButt-pf
Автор

How can i do this just for a specific product?

WorkWithJuan
Автор

Thanks its working for me baba ji its working love you to hogya 😂❤🎉

mwaleedtahir
Автор

thx, redirect works, but it doesn't show the woocommerce order summary, how can we add that also?

Joneszy
Автор

Unfortunately it's not working for me.

naomikoopmans
Автор

thanks it worked no issues nice explanation

zeeshaneastchem
Автор

my dear friend thank you for your support. love from INDIA

VedicAstrologer
Автор

Hey dude, i got an issue and wondering if you could shed any light, im using woocommerce with divi ive set a custom page for my checkout and payment etc works fine but once payments recieved it looks similar to the checkout page just a bit awful (its for a digital file download) its all off center the button is standard and theres like one blank collumn, any ideas on how i can edit this page i cant find it anywhere but it must exist right?

henchnerd
Автор

i dont see the code - where is it located?

astorymedia
Автор

Question: how can I re-direct my customer to my Download page for videos where they can get different downloads after they pay???

Thanks.

kandidmania
Автор

hey bro, when I do this it says this,

"Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP."

how do I fix it and get it to work?

taylorshields
Автор

So Simple, But IT WORKS !! THANK YOU SO MUCH.

ninaket