On the 21st January 2015 I wrote a tutorial about how to create a custom Thank you page in WooCommerce.

The article had and is still having a huge success (huge compared to the other articles on this blog). I received a lot of comments on it, and from the first version, I improved the script a lot following your feedbacks.

A week ago I decided to make your life easier so I wrote a new plugin for it, you will not need to add custom code anymore!

Download the plugin: https://wordpress.org/plugins/wc-custom-thank-you/

Requirements

Be sure to meet the following requirements before to use the plugin.

  • WordPress 4.1 or greater
  • WooCommerce 2.4 or greater
  • PHP version 5.2.4 or greater

The link above leads to the official plugin page on WordPress.org. You can download the plugin from there or from your WordPress Dashboard by going in Plugins > Add New. In the search field type WC Custom Thank You and you will get this (along with other plugins):

WC Custom Thank You on WordPress.org

Click on Install Now to install the plugin.

How to use it?

Using this plugin is easy and fast.Just activate it, then go to WooCommerce > Settings > Checkout and find the new option Thank You page. Choose there the page you want to use as your custom Thank You page.

The customer will be automagically redirected there as soon as they complete a purchase on your store.

Can I contribute?

Sure! You can contribute by reporting issues or working on the code in this repository on GitHub, or by translating the plugin in your language and submitting the translated files via email from the Contact page (there’s not a file field, so please upload them somewhere and send me the link to the file, like on Dropbox or Google Drive).


Download the plugin: https://wordpress.org/plugins/wc-custom-thank-you/

39 replies
  1. Lina
    Lina says:

    Great, thank you! I’ve just installed it, deleted the previous added code in functions.php, as well as the folder “custom-thank-you” that I uploaded to my ftp. but how can I customize (content & style) the thank you page now?

    Reply
    • Lina
      Lina says:

      ah, I found it – in the folder “templates”. but I guess it wont be update safe to make any changes there, right? Are there any advantages/disadvantages of using your code as plugin instead of pasting the code in functions.php? many thanks in advance!

      Reply
      • Nicola Mustone
        Nicola Mustone says:

        Hi Lina,
        you can override templates in wp-content/themes/your-theme/woocommerce/thankyou/. That way it will be update safe.

        The advantages are that you don’t need to know anything about coding and you don’t have to do any change to your theme unless you want to further customize the templates.

        Reply
  2. Drizzy
    Drizzy says:

    Just have to say how greatful I am thanks to you. Most people make you pay for these types of plugins but you sir are a life-saver! I usually don’t comment on blog comments (infact never have I ever) since im so lazy or just don’t care, but this time I just had to say thank you, thank you, thank you!

    Reply
    • Nicola Mustone
      Nicola Mustone says:

      Hi Giorgio,
      yes it is, you need to unhook this action:

      add_action( 'woocommerce_custom_thankyou_successful', array( $this, 'table' ), 20 );
      

      It includes the template thankyou/table.php in the Thank You page. By removing it you will completely remove the products table.

      There are other hooks you can remove as well if you want.

      Reply
      • np
        np says:

        I have added this action to my functions.php but it’s not working. I am not able to remove the order details from the thank you page. I also tried to change it using the checkout/thankyou.php in woocommerce templates, but it seems that it’s not coming from there?

        Reply
  3. Douwe
    Douwe says:

    Dear Nicola,
    First of all thanks for the really greatest plugin. It’s working very fine.

    But do you know how I can translate the items into dutch?
    Order
    Date
    Total
    Payment method

    Also the headings: Customer Details, Billing Address and Shipping Address

    with kind regards,
    Douwe

    Reply
    • Nicola Mustone
      Nicola Mustone says:

      Hi Douwe,
      you will find the POT in the folder /languages of the plugin. You can translate it in Dutch. If you want to translate it easily, just install the plugin “Loco Translate” (free on wordpress.org) and read its documentation to know how to use it to translate other plugins.

      Reply
  4. Scott
    Scott says:

    Hi There,

    I used the first part of your code to make a custom thank you page. I need to add the order details now and would like to use your plugin to do that.

    What i am unsure about is how do i use your plugin and get the order details + also have the customised elements that i have on my custom thank you page?

    Is that possible to do? I created the custom page just like described in your article and then placed the code into functions.php

    Thanks

    Reply
    • Nicola Mustone
      Nicola Mustone says:

      Hi Scott,
      yes it’s possible. The templates in the plugin are customizable. Just copy them in your theme, inside the folder woocommerce/checkout/thankyou/ and then edit them as you need.

      Remember to remove the code from the old tutorial from your functions.php file.

      Reply
  5. Eredit
    Eredit says:

    Hi there!
    Great plugin, thank you for your work!
    One question please, is it WPML (WordPress Multi Language) compatible please?
    Thanks for your answer!

    Reply
  6. Dominik
    Dominik says:

    Hi Nicola!

    I just installed your plugin and chose a new page to be redirected to but missing the order-details – how can I integrate them?

    Thanks!

    Reply
    • Nicola Mustone
      Nicola Mustone says:

      Hi James,
      Thanks for downloading it!

      The issue with your checkout page is probably due to your theme that is not 100% compatible with WooCommerce.
      It seems to me that it’s missing some HTML in the layout, and that causes the table to be aligned wrongly.

      I’d try to use a different theme to confirm the conflict. If it works on a different theme, you’ll want to contact the theme author and ask them to fix the bug.

      Reply
  7. Harmen
    Harmen says:

    Hello Nicola,

    I have tried to remove the order details from the thank you page with this hook:

    add_action( ‘woocommerce_custom_thankyou_successful’, array( $this, ‘table’ ), 20 );

    But it is not working. How can I deleted the order details from the custom page?

    Thanks!

    Reply
  8. James
    James says:

    Hello Nicola,

    Great Plugin!

    But do you have a plugin that can specify a different page for a different product?

    I sell different products and services and I need my thank you page to reflect what the customer has recently purchased. That way I can try and up sell them.

    Many thanks

    James

    Reply
    • Myles
      Myles says:

      Hi James,

      I just went through implementing this.

      You can add this code to your functions.php file: https://gist.github.com/SiR-DanieL/94cda62d2e7a622530179d0f4cd7b08c

      If you want multiple pages, modify it to look similar to this:


      foreach( $order->get_items() as $item ) {
      $_product = wc_get_product( $item['product_id'] );
      // Add whatever product id you want below here
      if ( $item['product_id'] == 60453 ) {
      // change below to the URL that you want to send your customer to
      wp_redirect('http://www.yoururl.com/your-thank-you-page');
      } elseif ( $item['product_id'] == 57657 ) {
      wp_redirect('http://www.yoururl.com/your-thank-you-page');
      } else {
      wp_redirect('http://www.yoururl.com/your-thank-you-page');
      }

      Then you can go to the ‘custom_redirect_after_purchase’ function in the woocommerce-custom-thankyou.php, comment out all of the previous code and add:

      do_action('wcs_redirect_product_based');

      Reply
  9. Chris Anson
    Chris Anson says:

    Hello,
    I so appreciate your work in creating this plugin.
    Is it compatible with:
    Woocommerce: 2.6.2
    WordPress 4.5.3

    thanks, Chris

    Reply
  10. Neil Peiman
    Neil Peiman says:

    Hi Nicola, I just happened to get a call to take an order from a new customer online. I went to the shop page, cart, checkout, completed the order, but the thank you page only showed the text I had entered and none of the order information. This is something new, not sure what’s causing it. Any thoughts let me know, in the meantime I’ll investigate further and see if its’ related to some other plugin or the latest WordPress update?

    Reply
  11. Evan Daws
    Evan Daws says:

    Hi Nicola,

    Just wanted to take a second to say thank you very much! the plugin is exactly what I was after and still retains all the order information on my custom page as I’d hoped!

    Anywhere to make a personal donation to you?

    Cheers,

    Evan Daws,
    Aldgate, South Australia.

    Reply
    • Nicola Mustone
      Nicola Mustone says:

      Hello Evan,
      Thank you so much! I really appreciate your offer but I can’t accept it. I don’t do this for money 🙂

      If you want to help, subscribe to the newsletter if you haven’t yet and share the blog with your friends! I’d be very happy with that.

      Thank you so much again, I really appreciate it.

      Reply
  12. Debby
    Debby says:

    Hello Nicola,

    Thank you so much for this great tutorial!
    Is it possible to add the order notes to the thank you page as well in the customer details?

    Kind regards,
    Debby

    Reply
  13. Shaun
    Shaun says:

    Will this plugin break my tracking pixel for FB and analytics? Really want custom thank you pages but don’t want the tracking to break.

    Thanks!

    Reply

Trackbacks & Pingbacks

  1. […] Nicola Mustone beschreibt in seinem Blog ausführlich, wie sich in WooCommerce eine individuelle Danke-Seite einrichten lässt und wie du diese mit typischen Content-Elementen bestücken kannst. Nun hat er mit WC Custom Thank You ein Plugin veröffentlicht, welches dir die Arbeit noch weiter erleichtert. Eine detaillierte Anleitung zur Einrichtung findest du hier. […]

  2. […] Update 17th August 2015: I released the free plugin WC Custom Thank You to automate what i wrote in this tutorial. Please check the plugin release article. […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

You have to agree to the comment policy.

This site uses Akismet to reduce spam. Learn how your comment data is processed.