Add to Cart button without automatically opening the shopping cart when clicked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can this be done? Currently when I click on the Add to Cart button for a sale item, a second window pops up for the shopping cart. When you click continue shopping, the window then closes (sometimes a "Close" button must be clicked in the pop-up message). Is there anyway to simply have the cart updated without popping up the window?
Thanks,
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PayPal's Website Payments Shopping Cart is designed to work one way. You add an item to the cart, the shopping cart screen is displayed, from there, you either continue shopping by returning to the web site or checkout. This behavior is by design and there are no features or options to change it. Depending your web browser, the shopping cart will open in the same window or a second window. There are tricks to change how it opens but you cannot stop it from opening each time.
If you go with a 3rd party shopping cart, most have their own built in features to control the cart behavior and you only see the PayPal Screens for the final check out. Also, note, most mini-carts are also designed to work that way.
If you're not using a 3rd party cart or a mini-cart and do not want a 2nd window to open when you add an item to the cart, the following tip applies:
Continue Shopping Button not working, missing or requesting a new browser window.
( These changes allow better functionality with IE, Firefox and Chrome. )
*** If you are using "clear text" item button meaning not "hosted" or "encrypted".
Modify the Form target line in both your Add to Cart and View Cart Button Code:
Replace the variable target="paypal" with the variable target="_self".
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_self">
Next, include the "shopping_url" variable to specify where the buyer will be returned after clicking the "Continue Shopping" button.
Add this line to your code to both your Add to Cart and View Cart Button Code:
<input type="hidden" name="shopping_url" value="http://www.yourwebsite.com/your_page.html">
*** If you are using Text Links:
Add the following to both your Add to Cart and View Cart Button Code:
&target="_self"&shopping_url=http://www.yourwebsite.com/your_page.html
*** If you are using "hosted" item button code:
In Step 3 of the button creation process look at the bottom you will see "Advanced Variables"
Note the text box near the bottom of the page. There you can insert extra variables.
Insert the "shopping_url" variable and value: shopping_url=http://www.yourwebsite.com/your_page.html
There's no HTML extras, just the name of the variable, an equal sign and the value.
Next, after you have created your "hosted" item button code.
Modify the Form target line:
Replace the variable target="paypal" with the variable target="_self".
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_self">
Finally, after you have made your changes to your item button code, be sure to delete your web browser's cookies before testing the changes. This ensures a clean start. Delete the browser's cookies, close the browser, reopen it and then test your code.
Regards,
skier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the very detailed reply. This will most likely be exactly what I need...particularly the leaving my site and then returning when clicking "Continue Shopping". Very good information.
Thanks again.
Paul

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Change Payment Method in About Payments
- Refund request : "The funds that were placed on temporary hold have been reversed" ? in Refunds and cancellations
- Page glitched during transaction, didn't fully load in Disputes and claims
- Spam email? in Access and security
- Tickets sent to invalid email address (via ticketmaster) in Disputes and claims