• Boatshoes

    (@boatshoes)


    Hi, Thank you for the plugin

    I am trying to redirect to another page after people purchase my product. I have seen on other forms that people ask the same question and people answer with just posting code and I dont know what to do with the code….as you might be able to understand I am not an expert, can some one help me understand what to do?

    Thank you

    https://wordpress.org/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Boatshoes

    (@boatshoes)

    I was wondering how to redirect people after checking out? there is some code in the form already but it doesnt tell you where to put it? Can some one help? thank you

    In general terms, you should first create a child theme. This is so your primary theme can be updated in future without overwriting any customisations. Next, you should create a file called functions.php in your child theme, and you use this file for your custom code. Any code in your child theme’s functions.php is executed before code in functions.php in the primary theme.

    I have not seen your code. It might not be what I envisage. Perhaps you could post a link to what you have seen.

    Thread Starter Boatshoes

    (@boatshoes)

    Thank you for your help

    http://wordpress.org/support/topic/redirect-after-checkout-in-woocommerce?replies=15
    This is the thread where they are talking about it…but I dont need a different redirect for every product.

    Thank you

    OK, create a child theme as above but you don’t need functions.php, not for this task anyway.

    The thread you quote gives 2 methods for redirects, the first applies to every product and I think that’s the method you want. The second is on a per product basis and I don’t cover it here.

    Look for this file:

    wp-content/themes/YOUR_CHILD_THEME/woocommerce/checkout/thankyou.php

    If it doesn’t exist, make the sub-directories if you need to, and copy the file from:

    wp-content/plugins/woocommerce/templates/checkout/thankyou.php

    to

    wp-content/themes/YOUR_CHILD_THEME/woocommerce/checkout/thankyou.php

    At this point, your customization will not be lost if you update WooCommerce.

    Add something like this at the end of thankyou.php: (Use a plain text editor, not MS Word)

    <script>
    window.location = 'http://redirect-to-this-page';
    </script>

    Of course alter the url to suit.

    If you get blank pages, your new file has a syntax error. Just rename your new thankyou.php to something else and that should get you going again.

    Unfortunately if it doesn’t work, debugging from this distance may not be easy, but post your url.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Redirecting after Purchasing’ is closed to new replies.