A client of mine suddenly had a problem with their shopping cart where when they clicked to add an item to the “Cart” the paypal pop-up window would state:
“Sorry — your last action could not be completed”
Now everything was working fine before and I am not sure what occurred but I believe I resolved the problem by commenting out the code commented below that specifies the “Upload” value. I am not sure why this works, maybe someone could shed some light on the issue or might have had the same problem. It must be something to do with the cart side of things as “target=“_xclick” worked fine without me commenting out the code.
Might be useful to anyone who is having a similar problem with advanced / custom payment forms and simple commerce.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" value="http://domainname.com/index.php?ACT=21" name="notify_url" />
<input type="hidden" value="http://domainname.com/index.php/thank_you" name="return" />
<input type="hidden" value="http://domainname.com/index.php/cancel" name="cancel_return" />
<input type="hidden" name="business" value="[email protected]" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="item_name" value="Product Title" />
<input type="hidden" name="item_number" value="91" />
<input type="hidden" name="amount" value="29.99" />
<input type="hidden" name="add" value="1" />
<!--
<input type="hidden" name="upload" value="1" /> // this line was commented out and now it works fine
-->
<input type="hidden" name="no_shipping" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="undefined_quantity" value="1" />
<input type="hidden" name="on0" value="Size">
<select name="os0">
<option value="">Choose a size…</option>
<option value="08">Size 08 --- (5 in stock)</option>
<option value="10">Size 10 --- (6 in stock)</option>
</select>
<input type="submit" class="button" name="submit" value="Add To Cart" alt="Add To Cart">
</form>