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

Fix the wrong return_url in multisite setup when using subdomains (2829) #2157

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

Narek13
Copy link
Collaborator

@Narek13 Narek13 commented Apr 15, 2024

PR Description

Replace the network_home_url() with home_url() to avoid wrong return url in multisite setup.

Issue Description

When using a multisite with subdomains or top-level domains, the return URL generated by PayPal Payments always points to the main site of the network.

Steps to Reproduce

  • Setup multisite network, with subdomains (top level domains)
  • The store is on sub site.
  • Purchase an item and pay with PayPal.
  • After payment, the redirect back to the page hits the multisite main page and not the sub-page.

@InpsydeNiklas InpsydeNiklas added this to the 2.7.0 milestone Apr 15, 2024
@Dinamiko Dinamiko merged commit bc35b6f into trunk Apr 18, 2024
7 checks passed
@Dinamiko Dinamiko deleted the PCP-2829-wrong-return-url-on-multisite-subsite branch April 18, 2024 08:09
@InpsydeNiklas InpsydeNiklas changed the title Fix the wrong return url in multisite setup (2829) Fix the wrong return_url in multisite setup when using subdomains (2829) Apr 22, 2024
@Dinamiko Dinamiko added the bug Something isn't working label Apr 22, 2024
@Dinamiko Dinamiko mentioned this pull request Apr 22, 2024
@darkopetreski
Copy link

darkopetreski commented Sep 16, 2024

I am experiencing the same error with 2.9.0 version.
The return url is domain.com/shop/shop/?.... and should be domain.com/shop?....
The problem occurs when I disable the smart button and do it with redirect:

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' );
});

Edit: I have created a new issue: #2604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants