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

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 161

  • @Reialesa
    @Reialesa  2 года назад +23

    Relevant videos:
    How to automatically redirect users from any page to any page, website or domain in WordPress: ruclips.net/video/7ZtnlkP0f08/видео.html
    How to redirect users to different pages based on which products they purchase after checkout in WooCommerce: ruclips.net/video/W7YRxqYhBeY/видео.html
    How to create a child theme in WordPress: ruclips.net/video/iRGn5Ypm1qw/видео.html
    The function required to do this 👇
    /**
    * Redirect WooCommerce to a custom page after checkout
    */
    add_action( 'woocommerce_thankyou', 'reialesa_redirect_woo_checkout');
    function reialesa_redirect_woo_checkout( $order_id ){
    $order = wc_get_order( $order_id );
    $url = 'your URL here';
    if ( ! $order->has_status( 'failed' ) ) {
    wp_safe_redirect( $url );
    exit;
    }
    }

    • @theHaloFM02
      @theHaloFM02 Год назад +1

      Thanks for putting the code here! Really simplifies our process in understanding and testing the code through functions.php out. 😁✨

    • @Reialesa
      @Reialesa  Год назад +1

      More than happy to help! Thank you for your support 💪

    • @becoonstudio1035
      @becoonstudio1035 5 месяцев назад

      how if failed purchase that same redirect to thank you page?

  • @naomikoopmans
    @naomikoopmans Год назад +1

    Hi, great video, thanks! Question: How do I make sure there is no other way to get to the 'Thank you' page other than through redirection after purchase? How do I prevent this page from appearing accidentally in Google search results? Thanks again.

    • @Reialesa
      @Reialesa  Год назад +1

      Hi! Thank you for the kind words. The easiest way to prevent people from finding the page is making sure the link doesn't appear anywhere where somebody can click on it. You can also set the link to something you're sure nobody will ever accidentally find. With that said, I doubt anyone will go around looking for that specific page, so I wouldn't worry too much if I were you.
      You can prevent the page from appearing in Google search results by using an SEO plugin such as Rank Math and making sure the page is set to ''No index''. That way, search engines won't index the page and it won't appear in search results. For more information, I recommend you check out this article: rankmath.com/kb/how-to-noindex-urls/

  • @davis.1193
    @davis.1193 Год назад +1

    Your channel is hugely undervalued. Quality is really good bro

    • @Reialesa
      @Reialesa  Год назад

      Thank you, I really appreciate that, it means a lot! 🙏🙌

  • @naomikoopmans
    @naomikoopmans Год назад

    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!

    • @Reialesa
      @Reialesa  Год назад

      Thanks for letting me know! Indeed, this only works for the pages of the website you use it on, not for redirecting to different, external websites. I'm very happy you managed to get it up and running! 💪

  • @niffostudios4129
    @niffostudios4129 7 месяцев назад +2

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

  • @abrarsaleem9980
    @abrarsaleem9980 Год назад

    Amazing, it worked. thanks, it's a request that I want that user should only see thankyou page when redirected from checkout only and redirect to 404 when they try to access directly from url

    • @Reialesa
      @Reialesa  Год назад

      Awesome, I'm happy to hear that. When it comes to blocking users from accessing the page directly, I think the easiest solution is to just leave it be. It's very unlikely anyone will actively go looking for a thank you page. On the off chance anyone does, it isn't a big deal if they have access to the page either.
      It's a good question, however, the only relevant information I've been able to find is this: stackoverflow.com/questions/19791037/disable-direct-access-to-a-wordpress-page
      Alternatively, you could try forcing users to log in before they are able to buy something and you could hide the page for users that aren't logged in. However, I wouldn't recommend that.
      Thank you for your support! 💪

  • @paulwhitehead1816
    @paulwhitehead1816 7 месяцев назад +1

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

  • @deltasignshop6309
    @deltasignshop6309 Год назад +1

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

    • @Reialesa
      @Reialesa  Год назад

      Correct me if I'm wrong, but that's likely because you're trying to link to another website, not another page. The page you redirect to needs to be a part of the website where the user is making the purchase.

  • @poppeken01
    @poppeken01 2 года назад +1

    Hello, can the redirection be different for different products?

    • @Reialesa
      @Reialesa  2 года назад +1

      Hello! Here's how you can do exactly that: ruclips.net/video/W7YRxqYhBeY/видео.html If you have a lot of products, however, I'd recommend looking for a good plugin to do this.

  • @kairimae2502
    @kairimae2502 10 месяцев назад +1

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

    • @narrayandeluck4188
      @narrayandeluck4188 9 месяцев назад

      The same here. Did you find out how to fix it?

    • @kairimae2502
      @kairimae2502 9 месяцев назад

      @@narrayandeluck4188 I took plugin "Thank You Page for WooCommerce". With that you can add thank you page in your product section, where you put price. You can make thank you page and add that URL there.

    • @Reialesa
      @Reialesa  9 месяцев назад

      There are quite a few possible reasons for that. If your permissions are all okay, it's most likely that a security plugin is hiding it. Disabling those options within the security plugin should allow you to access the Theme File Editor. Where they are depends on the plugin you're using.
      For the other possible reasons, this article explains it better than I could within a comment: nichetwins.com/wordpress-theme-editor-missing/

  • @kandidmania
    @kandidmania 11 месяцев назад

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

    • @Reialesa
      @Reialesa  10 месяцев назад +1

      That's a good question. The way I would approach it is by using a high quality membership plugin. Then, I would just redirect them to the proper page, which would otherwise be inaccessible to non-logged in users. Another alternative is to redirect them to a page that would contain a clickable link that would then take them to the proper page. You could redirect them to the page directly, without a membership plugin, but that would mean anyone could access it.
      I also have a video on how you can redirect users to different pages based on the different products they purchase: ruclips.net/video/W7YRxqYhBeY/видео.html
      I hope my answer was helpful. Let me know how it goes! 💪

  • @artistdigital535
    @artistdigital535 8 месяцев назад

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

  • @astorymedia
    @astorymedia Месяц назад

    i dont see the code - where is it located?

  • @outlawgeek420
    @outlawgeek420 Год назад

    Where is the code? Can't find it down below and Ive scrolled passed Australia 😅

    • @Reialesa
      @Reialesa  Год назад +2

      Sorry about that! RUclips won't let me post it in the description because of the ''angled brackets'' and the pinned comment is acting up. Sometimes it shows up correctly, sometimes it doesn't. Anyhow, here it is:
      /**
      * Redirect WooCommerce to a custom page after checkout
      */
      add_action( 'woocommerce_thankyou', 'reialesa_redirect_woo_checkout');
      function reialesa_redirect_woo_checkout( $order_id ){
      $order = wc_get_order( $order_id );
      $url = 'your URL here';
      if ( ! $order->has_status( 'failed' ) ) {
      wp_safe_redirect( $url );
      exit;
      }
      }

  • @Joneszy78
    @Joneszy78 2 года назад +1

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

    • @Reialesa
      @Reialesa  2 года назад +2

      The way I would do it is by using Elementor's purchase summary widget. That's gonna be the easiest and the fastest way. If you're not using Elementor or a page builder that offers this functionality, you'll have to find and use the appropriate WooCommerce hooks and then style the page via CSS. The other alternatives are styling the default checkout page with CSS or buying the official WooCommerce plugin (WooCommerce Custom Thank You Pages), but I've never used it so I can't say if it's worth it.

  • @tmclipsit
    @tmclipsit Год назад +1

    what if i have multiple products

    • @Reialesa
      @Reialesa  Год назад

      If you mean redirecting your user based on which product they purchase, here's how you can do that: ruclips.net/video/W7YRxqYhBeY/видео.html

  • @VedicAstrologer007
    @VedicAstrologer007 Год назад +1

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

    • @Reialesa
      @Reialesa  Год назад

      Right back at you, thank you! 🙏

  • @jacobasare2056
    @jacobasare2056 Год назад

    Hello Reialesa, how do I redirect to a thank you page for a specific product only and not all products in general?

    • @Reialesa
      @Reialesa  Год назад

      Hi! I have a video that will help you do exactly that: ruclips.net/video/W7YRxqYhBeY/видео.html
      Let me know how it goes! 💪

  • @purpose6113
    @purpose6113 Год назад

    Great, simple tutorial 👌
    I was wondering, how do I get a "child editor"? Im currently using divi

    • @Reialesa
      @Reialesa  Год назад +1

      Hello! Thank you for your awesome comment, I'm glad the video was helpful. If by ''child editor'' you mean a child theme, it's quite simple. Here's how you can create a child theme: ruclips.net/video/iRGn5Ypm1qw/видео.html

  • @AraibButt-p7f
    @AraibButt-p7f 3 месяца назад

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

  • @Hassan_Omer
    @Hassan_Omer 2 года назад +1

    It works, thank you very much for sharing this video.
    I have a question, is it possible to redirect to your custom page after Thank you page or Order details page ?

    • @Reialesa
      @Reialesa  2 года назад +1

      Hello! Awesome, I'm glad it helped. Redirecting to other pages from a new page is something I would do with a link or a button, so users have control over when it happens. So, use this to redirect them to whichever page and then on that page, include a link to where you want them to go next. The other way would be by using JavaScript so they get redirected automatically after a set amount of time, here's an example of how to do this: ruclips.net/video/7ZtnlkP0f08/видео.html

    • @Hassan_Omer
      @Hassan_Omer 2 года назад

      @@Reialesa Thank you very much for sharing this, i'll try this method.

  • @zeeshaneastchem7387
    @zeeshaneastchem7387 Месяц назад

    thanks it worked no issues nice explanation

    • @Reialesa
      @Reialesa  Месяц назад

      Awesome, that's great to hear. Thank you for your support! 🙏

  • @shamimarman5159
    @shamimarman5159 9 месяцев назад

    Where is code? Could you please give me the code?

    • @Reialesa
      @Reialesa  9 месяцев назад +1

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

  • @mwaleedtahir1707
    @mwaleedtahir1707 9 месяцев назад

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

    • @Reialesa
      @Reialesa  6 месяцев назад

      I'm happy to hear it's working for you, thank you for your support! 🙌

  • @sensibleced
    @sensibleced Год назад

    My Thank you page is blank and I want to show the order details. Any tips on how to fix this?

    • @Reialesa
      @Reialesa  Год назад

      For that, this likely isn't the best way. A better way would be to style the original thank you page and change out the content or, the easier way (usually), use whichever method your page builder allows. For example, I use Elementor and in Elementor, I would just add in the ''Purchase Summary'' widget to my page and set that page as the ''Purchase Summary'' page in my Site Settings. That would mean that page is the page that gets redirected to when an order is made, it would include the order details and I can add in any content I want and style everything however I want.
      Of course, that means you don't need the method shown in the video.
      The method shown in the video is perfect for setting thank you pages that are disconnected from the actual usual checkout process or for page builders that don't have that option.
      If that applies to your situation, you can try adding in the shortcode [woocommerce_checkout] to your page but I'm not sure how effective the combination is going to be. Let me know how it goes! 💪

  • @bms3555
    @bms3555 Год назад

    ITS WORKING ! THANK YOU

    • @Reialesa
      @Reialesa  Год назад

      That's awesome, thank you for your support 💪

  • @LuxuryCars-n8n
    @LuxuryCars-n8n 2 года назад

    Oh. Thank you very much bro. It is important reduce installing any plugins, which reduces speed of website.

    • @Reialesa
      @Reialesa  2 года назад +1

      Indeed! If you can avoid an extra plugin with something like this, which I feel is easier than actually setting up the plugin in the first place, it's a win-win situation. Thank you for your support.

  • @ninaket
    @ninaket Год назад

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

    • @Reialesa
      @Reialesa  Год назад

      Happy to help, thank you for your awesome comment! 🙌

  • @naomikoopmans
    @naomikoopmans Год назад

    Unfortunately it's not working for me.

  • @sambucolazerbaijan
    @sambucolazerbaijan 8 месяцев назад

    What If I want to add different thank you pages for different products checkout

    • @Reialesa
      @Reialesa  8 месяцев назад

      Hello! I have a video that will show you how to do exactly that. Here it is: ruclips.net/video/W7YRxqYhBeY/видео.html

  • @heeebeeegeeebeee
    @heeebeeegeeebeee Год назад

    Worked perfectly, thank you!

    • @Reialesa
      @Reialesa  Год назад

      Awesome 🤜🤛 Glad I could help!

  • @taylorshields7119
    @taylorshields7119 2 года назад +1

    hey again, i updated my them and tried to re-do the code again as it worked after you help last time, but now after disabling the security plugins like last time its still not working??

    • @Reialesa
      @Reialesa  2 года назад

      Okay, let's start from the beginning. 1. Which theme are you using? 2. Are you using a child theme? 3. Try to install a file manager plugin (Advanced File Manager for example), then try adding the code inside the functions.php file via that plugin directly (wp-content > themes > your child theme > functions.php > right click and edit). Don't forget to backup first 😁

    • @taylorshields7119
      @taylorshields7119 2 года назад +1

      @@Reialesa I'm using the Divi theme, but I can't seem to find a child Divi theme. As you mentioned in the vid I presume this is the issue when updated the theme, I restored my backup to get back to when it was working so would it be ok if I just don't update my theme?

    • @Reialesa
      @Reialesa  2 года назад

      Okay, so that's likely the issue. The best way to go about this is to install a plugin called Child Theme Configurator. Then, using the plugin, create a child theme, it's very simple. If you get stuck, my ''Elementor Beginner Tutorial'' video shows how it's done at around 3 minutes 30 seconds. Next, activate the child theme (you can also uninstall the plugin after you create the child theme). The next step is to edit the functions.php again and in your case, you might have to disable the security plugin to do so, just like you did the first time. If you aren't using a child theme, all of the changes you make to a theme disappear when it gets updated. I wouldn't recommend simply not updating your theme because some updates may be very important, so a child theme is the perfect solution.

    • @taylorshields7119
      @taylorshields7119 2 года назад

      @@Reialesa brilliant, I'll give that a go and let you know if it doesn't work. Thanks heaps mate your a legend !

    • @taylorshields7119
      @taylorshields7119 2 года назад

      @@Reialesa I tried that and it didn't work, I'm not using elementaor builder I'm using the divi builder and what do I do once I've activates the child theme plugin as nothing seems to change once I installed it ?

  • @wavenfx
    @wavenfx Год назад

    What if the payment fails? How´d be the code to redirect people to a
    "failed payment" url??

    • @Reialesa
      @Reialesa  Год назад

      Interesting question! I actually did some testing and it always stays on the checkout page in my experience. Which is, honestly, likely the best way to go about it - if your user makes a typo while trying to make a purchase, you probably don't want them to be redirected and have to go through the whole process again. I wish I had a more specific answer for you but at this time, I can't seem to find a viable way to make this happen.

  • @taylorshields7119
    @taylorshields7119 2 года назад +1

    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?

    • @Reialesa
      @Reialesa  2 года назад

      Hello! I've never encountered this issue, but here's what I've gathered from doing some research; first off, I'd try disabling any security plugin you have and see if that helps (don't forget to enable it back). It could also be theme permissions or other plugins causing the issue. Otherwise, you'll probably have to edit the files with something like FileZilla. I recommend you copy the error into Google and go off that, lots of cases of this issue popping up. Let me know how it goes!

    • @taylorshields7119
      @taylorshields7119 2 года назад +1

      @@Reialesa thanks bro, I'll give those a try

  • @Saur
    @Saur Год назад +2

    Thanks for this. It is exactly what I'm looking to do.

    • @Reialesa
      @Reialesa  Год назад

      Awesome, glad I could help!

  • @HaifengZhu-pn3uq
    @HaifengZhu-pn3uq 8 месяцев назад

    Hi, how can I access the default WooCommerce thank you page?

    • @Reialesa
      @Reialesa  Месяц назад

      You should try making a test purchase. If you're using Stripe, enable the 'Test' mode and make a purchase. It will redirect you to the default page.

  • @anouarhimad
    @anouarhimad Год назад

    it's not working for me , I get this message " 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."

    • @Reialesa
      @Reialesa  Год назад

      Try disabling any security plugins you have and see if that helps (don't forget to enable them back afterwards). It could also be because of a certain plugin or because of theme permissions. If none of these work, edit the files directly via cPanel or, if you don't have cPanel, try using something like FileZilla to edit them. If all else fails, I recommend copying the error into Google as you'll find many people have this issue for many different reasons. Let me know how it goes!

  • @j.l.cooper70
    @j.l.cooper70 Год назад

    Love this! how to I redirect to a different page per product?

    • @Reialesa
      @Reialesa  Год назад

      I'm glad you like it! To redirect to different pages based on the product purchased, check out this video: ruclips.net/video/W7YRxqYhBeY/видео.html

  • @manojperera1740
    @manojperera1740 2 месяца назад

    It's worked. Thank you

    • @Reialesa
      @Reialesa  Месяц назад

      That's great to hear, thank you for your support! 🙌

  • @darioperiskic4335
    @darioperiskic4335 2 года назад

    Bravo, samo naprijed 👍🏻

  • @H4MM4D-11
    @H4MM4D-11 Год назад

    But Mate what If I have added my paypment Gateway Pyapal so Obviusly when some one fill information on Checkout it will redirect them to thier paypal Right how can I redirect buyer to my Thank you page when client succesfully paid from Paypal

    • @Reialesa
      @Reialesa  Год назад

      Good question. That's something I haven't tried to do yet but it seems like something you have to set up directly in PayPal.
      I found this and I think it will help you out: www.paypal.com/us/cshelp/article/FAQ3651
      Let me know how it goes! 💪

  • @jayroo10
    @jayroo10 Год назад

    Where is the code? I can't see it anywhere, did you take it off?

    • @Reialesa
      @Reialesa  Год назад

      Sorry about that! RUclips won't let me post it in the description because of the ''angled brackets'' and the pinned comment is acting up. Sometimes it shows up correctly, sometimes it doesn't. Anyhow, here it is:
      /**
      * Redirect WooCommerce to a custom page after checkout
      */
      add_action( 'woocommerce_thankyou', 'reialesa_redirect_woo_checkout');
      function reialesa_redirect_woo_checkout( $order_id ){
      $order = wc_get_order( $order_id );
      $url = 'your URL here';
      if ( ! $order->has_status( 'failed' ) ) {
      wp_safe_redirect( $url );
      exit;
      }
      }

  • @madtings6736
    @madtings6736 8 месяцев назад

    I cant locate the code with the function in the description

    • @Reialesa
      @Reialesa  8 месяцев назад

      Hello! It's available in the pinned comment. Here it is 👇
      /**
      * Redirect WooCommerce to a custom page after checkout
      */
      add_action( 'woocommerce_thankyou', 'reialesa_redirect_woo_checkout');
      function reialesa_redirect_woo_checkout( $order_id ){
      $order = wc_get_order( $order_id );
      $url = 'your URL here';
      if ( ! $order->has_status( 'failed' ) ) {
      wp_safe_redirect( $url );
      exit;
      }
      }

  • @Lesslypl
    @Lesslypl Год назад

    Doesn't it mess up with meta pixel and google analytics?

    • @Reialesa
      @Reialesa  Год назад

      Good question. I'd imagine it shouldn't affect your analytics or ads in most cases but I can't say for sure. For example, if, in your ads, your conversion event is simply your users arriving at the thank you page, it shouldn't be a problem. For others, I can't say for sure. The very best (and pretty much the only) way to figure out how it affects your analytics or advertising efforts is to thoroughly test it out for your specific website.

  • @ajbonline
    @ajbonline Год назад

    Thank you this helped me out quite a bit.

    • @Reialesa
      @Reialesa  Год назад

      I'm very happy you found the video helpful. Thank you for your support, I appreciate it! 🙌🙏

  • @stomataaa
    @stomataaa Год назад

    I try but it says "Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP."
    I use multi site and try to implement it in the main dashboard
    please guide me :)

    • @Reialesa
      @Reialesa  Год назад

      Hi! Unfortunately, I've never used multisite before but I can try to speculate why this doesn't work. This is based on redirecting to a specific thank you page and because of that, it will not work for redirecting to external websites or domains, so it will only work for one website at a time. So, if you add it to your multisite functions.php file, it adds it to all of them at once and you get the error. What I recommend you do is try to find a way to insert the code to just one website.
      The first thing I would try is creating child themes for every individual website. After you do that, technically, every website should be able to have its own functions.php file. After that, you can just add in your code to the appropriate child theme. I would recommend using a plugin called ''Child Theme Configurator'' to do this. I have a video on how to set it up on my channel. More about using the child themes here: wordpress.stackexchange.com/questions/81886/wordpress-multisite-multiple-child-theme
      If that doesn't work, here's another, more complicated, way you can try: stackoverflow.com/questions/28656909/wordpress-multisite-add-function-to-functions-php-to-only-affect-1-site
      I hope this was helpful. Good luck and let me know how it goes! 💪

  • @IbrahimSalmi-i3t
    @IbrahimSalmi-i3t Год назад

    doesn't work , it redirects me on my own admin wp website? any solutions? thanks in advance

    • @Reialesa
      @Reialesa  Год назад

      Hi! That happens if you try to redirect to another website. This only works for redirecting to different pages, not external websites.

  • @ShanawarButt-ez1qj
    @ShanawarButt-ez1qj 7 месяцев назад

    where is the code?

    • @Reialesa
      @Reialesa  5 месяцев назад

      Here you go (you can also find it in the pinned comment):
      The function required to do this 👇
      /**
      * Redirect WooCommerce to a custom page after checkout
      */
      add_action( 'woocommerce_thankyou', 'reialesa_redirect_woo_checkout');
      function reialesa_redirect_woo_checkout( $order_id ){
      $order = wc_get_order( $order_id );
      $url = 'your URL here';
      if ( ! $order->has_status( 'failed' ) ) {
      wp_safe_redirect( $url );
      exit;
      }
      }

  • @walidettaoussi1811
    @walidettaoussi1811 10 месяцев назад

    where is the code

    • @Reialesa
      @Reialesa  9 месяцев назад

      Hi. It's available in the pinned comment. Here it is 👇
      /**
      * Redirect WooCommerce to a custom page after checkout
      */
      add_action( 'woocommerce_thankyou', 'reialesa_redirect_woo_checkout');
      function reialesa_redirect_woo_checkout( $order_id ){
      $order = wc_get_order( $order_id );
      $url = 'your URL here';
      if ( ! $order->has_status( 'failed' ) ) {
      wp_safe_redirect( $url );
      exit;
      }
      }

  • @MdJahirulIslam-m2j
    @MdJahirulIslam-m2j 14 дней назад

    Thank you very much. From Bangladesh.

  • @KabyLake-y8z
    @KabyLake-y8z 2 дня назад

    Thank you so much bro

  • @web_wing
    @web_wing Год назад

    Thank you my man

    • @Reialesa
      @Reialesa  Год назад

      Happy to help, thank you for the kind comment! 💪

  • @todorzubac7476
    @todorzubac7476 Год назад

    where i can download the php code?

    • @Reialesa
      @Reialesa  Год назад

      Hi! Looks like the pinned comment is acting up again. Sometimes it shows up correctly, sometimes it doesn't. Anyhow, here it is:
      /**
      * Redirect WooCommerce to a custom page after checkout
      */
      add_action( 'woocommerce_thankyou', 'reialesa_redirect_woo_checkout');
      function reialesa_redirect_woo_checkout( $order_id ){
      $order = wc_get_order( $order_id );
      $url = 'your URL here';
      if ( ! $order->has_status( 'failed' ) ) {
      wp_safe_redirect( $url );
      exit;
      }
      }

  • @dandrevs
    @dandrevs Год назад

    Hey, I need to redirect to external URL but once I input that, once I do the payments, it redirects me to wp-admin page. Is this only for internal linking?
    Maybe to add more context. I'm on Breakdance builder so no child theme. I'm using Advanced Scripts to store and execute code.

    • @Reialesa
      @Reialesa  Год назад +1

      Hi! You're quite right, this only works for internal linking and redirecting to different pages, not different websites.

    • @dandrevs
      @dandrevs Год назад

      @@Reialesa thanks. Makes sense now.

    • @Reialesa
      @Reialesa  Год назад

      I created a new video that explains how you can automatically redirect to any (external) website in WordPress. And, of course, you can use it to redirect your users after checkout as well. Here's the video: ruclips.net/video/7ZtnlkP0f08/видео.html

  • @marcelllamariadebruijn5714
    @marcelllamariadebruijn5714 8 месяцев назад

    dont find the code...

    • @Reialesa
      @Reialesa  8 месяцев назад

      Hello! It's available in the pinned comment. Here it is 👇
      /**
      * Redirect WooCommerce to a custom page after checkout
      */
      add_action( 'woocommerce_thankyou', 'reialesa_redirect_woo_checkout');
      function reialesa_redirect_woo_checkout( $order_id ){
      $order = wc_get_order( $order_id );
      $url = 'your URL here';
      if ( ! $order->has_status( 'failed' ) ) {
      wp_safe_redirect( $url );
      exit;
      }
      }

  • @katcd1916
    @katcd1916 2 года назад

    Thank you so much for this video! It helped me a lot!!!

    • @Reialesa
      @Reialesa  2 года назад

      Awesome, I'm really glad you found it helpful! 💪

  • @KillahManjaro
    @KillahManjaro Год назад

    Thanks. Sub!
    Can I use Code Snippet plugign with this? I like to have all my custom codes in one place.

    • @Reialesa
      @Reialesa  Год назад

      I'm happy to help, thank you for your support, I appreciate it! 💪 I've never used the Code Snippets plugin, but as far as I can tell, that's exactly what it's for, so it should work just fine. Let me know how it goes! 🤞

    • @KillahManjaro
      @KillahManjaro Год назад

      @@Reialesa Will do. No problem with the support.

  • @JJ-vh2vp
    @JJ-vh2vp Год назад

    quick and easy. Thank you!

    • @Reialesa
      @Reialesa  Год назад

      I'm happy to help, thank you for your support, I appreciate it! 🙏

  • @117zenith
    @117zenith Год назад

    Legend!

    • @Reialesa
      @Reialesa  Год назад

      Thank you, right back at you! 🙌

  • @MrHausMausRap
    @MrHausMausRap 6 месяцев назад

    Perfect, thank u🎉

    • @Reialesa
      @Reialesa  5 месяцев назад +1

      Thank you for your support! 😄🙌

  • @winzmall7595
    @winzmall7595 Год назад

    How to find code

    • @Reialesa
      @Reialesa  Год назад

      Hi! Here it is (you can also find it in the pinned comment) 👇
      /**
      * Redirect WooCommerce to a custom page after checkout
      */
      add_action( 'woocommerce_thankyou', 'reialesa_redirect_woo_checkout');
      function reialesa_redirect_woo_checkout( $order_id ){
      $order = wc_get_order( $order_id );
      $url = 'your URL here';
      if ( ! $order->has_status( 'failed' ) ) {
      wp_safe_redirect( $url );
      exit;
      }
      }

  • @moseskramer5346
    @moseskramer5346 Год назад

    Awesome content 😁Anybody any idea on how to implement with multilanguage Wordpress shop? using polylang for woocommerce and want to redirect to static page according to language setting of user

    • @Reialesa
      @Reialesa  Год назад

      Great question. I would assume the page gets translated, just like any other page, if the user chose a specific language. For example, I'm using TranslatePress and when somebody visits the Slovenian version of my website, the URL is reialesa.com/sl/. Any page they then visit has /sl/ in the URL as well, for example, reialesa.com/sl/branding. Meaning, every other page they visit is also translated.
      I haven't worked with Polylang yet but I assume the way it works is similar, if not the same. So, I also assume the thank you page should work like other pages and get automatically redirected to the correct language like other pages.
      I found this and, after giving it a quick read, I think your issue is connected to the way Polylang approaches URLs: polylang.wordpress.com/documentation/setting-up-a-wordpress-multilingual-site-with-polylang/settings/
      I recommend you go through it, it just might give you the answers you need.
      Thank you very much for your support and kind words! 🙌

  • @naomikoopmans
    @naomikoopmans Год назад

    Thank you!

  • @khalidsblog786
    @khalidsblog786 8 месяцев назад

    not work brother🙁🙁

    • @Reialesa
      @Reialesa  Месяц назад

      I'm sorry to hear that! Could you please provide a little more information? What happens after the purchase is completed?

  • @HZGamingVR
    @HZGamingVR Год назад

    Thank you very much! :)

    • @Reialesa
      @Reialesa  Год назад +1

      You are very welcome! Thank you for your support. 🙌

  • @yusufs_solos
    @yusufs_solos Год назад

    Thanks bro it helps me alot

    • @Reialesa
      @Reialesa  Год назад

      I'm happy to hear that, thank you for your support! 🙏

  • @AllWebSolutions
    @AllWebSolutions Год назад

    Thank you so Much, You save my time thanks

    • @Reialesa
      @Reialesa  Год назад

      That is great to hear, I'm happy to help. Thank you for your support! 🙌

  • @ArtPrintRevolution
    @ArtPrintRevolution Год назад

    available down below @ 0:45 where in australia? ffs!

    • @Reialesa
      @Reialesa  Год назад +1

      You're right, I just noticed the pinned comment isn't always displaying correctly. It's most likely a bug, hopefully it gets fixed soon! 🤞

  • @bensof6567
    @bensof6567 2 года назад

    Thank youuuuuuuuu thank you very very veeeeeeryyyyyyy much 😁😍

    • @Reialesa
      @Reialesa  2 года назад +1

      You are very welcome, I'm glad the video was helpful! 💪

  • @hassenzouari2479
    @hassenzouari2479 Год назад

    Thank you so much

    • @Reialesa
      @Reialesa  Год назад

      Thank you for your support 👐

  • @ariookii3685
    @ariookii3685 7 месяцев назад

    Thankss, verry helpful

    • @Reialesa
      @Reialesa  5 месяцев назад

      It's great to hear you found the video helpful, thank you for your support! 🙌

  • @mibesports2575
    @mibesports2575 Год назад

    Thank you

  • @hari4375
    @hari4375 2 года назад

    thanks sir...

    • @Reialesa
      @Reialesa  2 года назад

      You're very welcome, thank you for your support!

  • @utmanzpoultryreviews1931
    @utmanzpoultryreviews1931 2 года назад

    Simple ❤

    • @Reialesa
      @Reialesa  2 года назад

      Glad you liked it!

  • @ramakrishnapanigrahi
    @ramakrishnapanigrahi Год назад

    Please make more wocommerce videos

    • @Reialesa
      @Reialesa  Год назад

      I can't make any promises but as soon as I find something worth making a video about, I'll make it! WooCommerce is a very extensive topic, so I'm sure something will come up sooner rather than later.

  • @webculturetechnologies5517
    @webculturetechnologies5517 2 года назад

    Great

  • @kemissalinas7235
    @kemissalinas7235 Год назад

    thanks

    • @Reialesa
      @Reialesa  Год назад

      Happy to help, thank you for your support 🙏

  • @blackmanonline9099
    @blackmanonline9099 3 месяца назад

    thank you !