Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong return_url in multisite setup when using subdomains with place order button #2604

Open
darkopetreski opened this issue Sep 16, 2024 · 0 comments

Comments

@darkopetreski
Copy link

darkopetreski commented Sep 16, 2024

Describe the Bug

I am using a subdomain for the wordpress, domain.com/shop.
Due GDPR and requiremens of the client I am disabling the smart button and use the paypal redirect, with the following code as described here https://github.com/woocommerce/woocommerce-paypal-payments/wiki/Actions-and-Filters#disable-checkout-smart-buttons

add_filter('woocommerce_paypal_payments_use_place_order_button', '__return_true');
add_filter('woocommerce_paypal_payments_place_order_button_text', function() {
    return __( 'Place order', 'woocommerce' );
});

When the user pays the order a redirect is made back to the shop. But the redirect is wrong.

To Reproduce

  1. Setup the wodrepss as subdomain, domain.com/shop
  2. Add the code from above to functions.php
  3. Add item to cart and go to the cart
  4. Click the button to pay the order
  5. Pay the order with paypal
  6. The return url is wrong, /shop/shop?...

Screenshots

Expected Behavior

The return url should be domain.com/shop?....

Actual Behavior

The return url is: domain.com/shop/shop?....

Environment

  • WordPress Version 6.2.2
  • WooCommerce Version 9.3.1
  • Plugin Version 2.9.0
  • Browser and Version Any browser
  • Any other plugins installed

Additional info

There is a fix for a similar bug here #2157

@darkopetreski darkopetreski changed the title Wrong return_url in multisite setup when using subdomains Wrong return_url in multisite setup when using subdomains with place order button Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant