davids_media Posted April 18, 2012 Share Posted April 18, 2012 I have an Add To Cart button in my website so when a user adds an item to a paypal cart, it directs from webpage to test store as a variable is passed. Here is the code; <p> <form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="item_name" value="<?php echo $row['product']; ?>"> [quote]Works perfectly[/quote] <input type="hidden" name="amount" value="<?php echo $row['price']; ?>">[quote]Works NOT SO perfectly[/quote] <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="hosted_button_id" value="7UCL9YCYYXL3J"> <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> </p> The "item_name" type passes variable value to test store perfectly. So if a user adds item "shoes" to cart, its passes that item fine. But it should also pass the appropriate product price too (e.g. £1.99) but it does not. How can I solve this please as my code looks fine except for that bit. Quote Link to comment https://forums.phpfreaks.com/topic/261180-very-minor-paypal-sandbox-problem/ Share on other sites More sharing options...
batwimp Posted April 18, 2012 Share Posted April 18, 2012 Are you sure $row['price'] contains and actual value when it's written to the form? Quote Link to comment https://forums.phpfreaks.com/topic/261180-very-minor-paypal-sandbox-problem/#findComment-1338484 Share on other sites More sharing options...
davids_media Posted April 18, 2012 Author Share Posted April 18, 2012 yes, its data type is set to decimal(6,2) and every record has a price, each of which are different Quote Link to comment https://forums.phpfreaks.com/topic/261180-very-minor-paypal-sandbox-problem/#findComment-1338488 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.