HELP all my add to cart buttons have been broken!

orerockon_dvd
Contributor
Contributor

If you don't want to wade through this, in short, the custom add to cart buttons on my website were all broken, I do this many times a week, and it's not practical for me to generate dozens of hosted buttons every week. I need a way to copy and paste a snippet of code, change the item name and price, then upload it. Like I have been doing for over 15 years.

 

Long version: ALL of the (hundreds of) add to cart buttons on my website stopped working. I was alerted by a shopper that some buttons worked for them, then the next button, and all subsequent buttons they clicked came up with the incredibly unhelpful "Things don't appear to be working at the moment. Please try again later." So I tried the same ones that they did, and they were STILL BROKEN. I tried on my phone and as far as I could tell ALL the buttons were BROKEN. I had my wife try on her phone and they ALL WORKED. I went back to my computer and tried again and they ALL WORKED. Then a couple days later another shopper said that they were ALL BROKEN. I tried, my wife tried, and they were ALL BROKEN. The next morning I tried again  on my PC and they ALL WORKED. A couple days later I tried again and they were ALL BROKEN. They are still ALL BROKEN. The ONLY way I can get a working button again is to create a new shopping cart button, which gives totally different code than it used to (I haven't created a button in a while so I don't know how or why or when that changed). It shows up as a <form></form> now and my html editor Dreamweaver doesn't like that, so it shows up as broken code. I uploaded the page and the new button WORKED. The old buttons were ALL BROKEN. 

 

For reference the old code that Paypal BROKE was this (it has been working for at least 15 years - you can try it and see for yourself):

 

<a href="#" onClick="window.open('https://www.paypal.com/cart/add=1&business=dvd%40orerockon.com&item_name=Big+Fat+Obsidian+Needles&am...');"><img src="cart.gif" align="absmiddle"
border="0" height="24" width="37" /></a>

 

The new button that I generated looked like this, which does me no good whatsoever, as I would have to have HUNDREDS of hosted buttons and change them on an almost daily basis since I have hundreds of items and when I sell (some of them that are a single item) I take them down and replace them with a new item, with a new name, and a new price, which would require a new hosted button. 

 

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="7X3RZTSJ8FJN4">
<input type="image" src="http://orerockon.com/cart.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

 

Does anyone have a fix for this that DOES NOT require hosted buttons???

 

Login to Me Too
4 REPLIES 4

davidascher
Contributor
Contributor

were you able to find a solution to this issue? I'm experiencing the same thing on my site. Buttons worked just fine until ... they stopped working.

Login to Me Too

Orerockon
Contributor
Contributor

No. I scrapped them and started over with all new code that I ripped from the add to cart button code. It was extremely painful and also now painful to edit.

Login to Me Too

davidascher
Contributor
Contributor

Thank you for getting back to me. The code I was dealing with was written by somebody back in 2018 (which is getting to be a very long time ago as these things go). I was able to rewrite what was one form with three different buttons so it was instead three separate forms - a minor pain but not too terrible. Once I got it all of them working I looked at the old code again and I cannot imagine how it was ever actually functioning correctly. It's a mystery, but I suspect that PayPal might have decided to be more strict about accepting requests that do not strictly follow the rules. In this case, there were values passed by the single form that were needed for one of the buttons but not for the others. I suspect that PayPal was happy to ignore the irrelevant values in 2018 but somebody decided that might be a security hole, so they rewrote their end to be more strict about the values they are passed. It certainly would have been simpler to figure this out if their failure report was updated to something that is not completely useless as well as misleading - that message "Things don't appear to be working at the moment. Please try again later" implies that there's nothing wrong with what you've sent them, but their systems are 'temporarily' out of service. That seems to be absolutely not the case. They KNOW that you've sent them extra values along with the specific hosted button that was clicked and they know that they do not accept those extra values. It would only be 'polite' to say so.

 

I'm surmising, of course. Their docs are fairly impenetrable unless you've been doing nothing else but working with PayPal payments for the past 10 years or more and followed how they evolved from their humble and simple beginnings to the complex, behemoth capable of dealing with almost every variation on the sales and money collection behemoth they've become. Luckily for me, they are still supporting the (deprecated) very old and much simpler and more limited set of online money collection processes that they accepted 5 or more years ago. I think, in the end, I spent more time getting the credentials I needed from the site manager - who understands nothing about this stuff - than I did with updating the code.

 

Login to Me Too

Orerockon
Contributor
Contributor

Yes I was using practically fossilized code. Crazy thing it worked, then didn't work, then worked, they finally broke on all my pages. FYI this was a pretty simple fix (albeit WAY more complicated than my broken buttons, and without deleting all the parameters). So all I have to change is the item_name and amount parameters to replicate it. 1000 times. Which took me days. Hopefully they don't **bleep** it up again (but they will).

 

<!--START Paypal button-->
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="XXX">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="item_name" value="Cerium Oxide Polish">
<input type="hidden" name="amount" value="6.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="shopping_url" value="XXX">
<input type="image" name="submit" src="Add to cart text.png" alt="Add to Cart">
<img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>
<!--END Paypal button-->

 

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.