How to redirect the user to my page at the parent window
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a site in which I have a private shopping cart. After filling the cart, the user is redirect to Paypal for payment.
In order to redirect the user to my page after payment I am using the following code:
<input type="hidden" name="return" value="purchase-complete" >.
The problem is that the payment window is opened in a child window, and the redirection is to that child.
I would like that after payment, the child window will close and the parent window will be redirected to the desired address.
Can anyone tell if this is possible?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assuming you have "auto return" enabled you would want to make the following tweak to your code.
Change target="paypal" to target="_self". This will keep the shopping cart page on the same page. See example below:
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr method="post">
The HTML command target="_self" puts the new document in the same window as the current document. Some web browsers like FireFox, Chrome and older versions of IE will open a new or second window to display a new document. In order to prevent having multiple windows open while doing a task, it's recommended to use target="_self".
Then you "return" line would have the full path back to your site:
<!-- Replace value with the web page you want the customer to return to after a successful transaction -->
<input type="hidden" name="return" value="http://www.yourwebsite.com/compete.html">

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Redirection to PayPal not working in About Payments (Archive)
- woocommerce credit card payment gateway not showing up in Payment gateways page in About Settings (Archive)
- woocommerce credit card payment gateway not showing up in Payment gateways page in About Business (Archive)
- Instant Redirect (or shortened) in About Business (Archive)