Title: Error redirecting
Last modified: July 10, 2017

---

# Error redirecting

 *  [somaestudio](https://wordpress.org/support/users/somaestudio/)
 * (@somaestudio)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/error-redirecting/)
 * Hello Tahir, great plugin, simple but really useful for digital downloads.
    It
   works smoothly with a free product example I have on my site but I have problems
   returning from the payment platform (Paypal and PayU) to the thank you page, 
   is not redirecting to the order-received page and the download is not starting,
   instead it redirects to a thankyou page that I previously set. What can I do 
   in order to make it work? Thanks for all your help in advance!

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

 *  Plugin Author [Tahir Yasin](https://wordpress.org/support/users/tahiryasin/)
 * (@tahiryasin)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/error-redirecting/#post-9307549)
 * Thanks for liking the plugin.
 * The redirection is not part of plugin rather it’s a feature of Woocommerece. 
   After you return from a payment gateway, you can still open up order details 
   page where the download will automatically start.
 * But, you may need to customize Woocommerce to customize “return” parameter (for
   PayPal) as your order details page url instead of a static thank you page.
 * Hope that helps.
    -  This reply was modified 8 years, 11 months ago by [Tahir Yasin](https://wordpress.org/support/users/tahiryasin/).
 *  Thread Starter [somaestudio](https://wordpress.org/support/users/somaestudio/)
 * (@somaestudio)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/error-redirecting/#post-9308737)
 * Hello Tahir, thanks for your answer!
    Which url would be the order details page
   in order to work? Because the id changes for each order. Many thanks for your
   help.
 * Best,
 *  Plugin Author [Tahir Yasin](https://wordpress.org/support/users/tahiryasin/)
 * (@tahiryasin)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/error-redirecting/#post-9311046)
 * You have to override existing return_url, woocommerce provides a filter hook `
   woocommerce_get_return_url` for that purpose
 *     ```
       add_filter('woocommerce_get_return_url', 'override_return_url', 10, 2);
   
       function override_return_url($return_url, $order) {
           return $view_order_url = esc_url($order ->get_view_order_url());
       }
       ```
   
 * This way your return_url will become the url of order view page.
 * Hope that helps. Cheers !

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

The topic ‘Error redirecting’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-automatic-download_61521e.
   svg)
 * [WooCommerce Automatic Download](https://wordpress.org/plugins/woocommerce-automatic-download/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-automatic-download/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-automatic-download/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-automatic-download/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-automatic-download/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-automatic-download/reviews/)

## Tags

 * [automatic](https://wordpress.org/support/topic-tag/automatic/)
 * [download](https://wordpress.org/support/topic-tag/download/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tahir Yasin](https://wordpress.org/support/users/tahiryasin/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/error-redirecting/#post-9311046)
 * Status: not resolved