swissbeets Posted July 13, 2008 Share Posted July 13, 2008 $product_set = get_cart($cookie_id); while($row = mysql_fetch_array($cart_set)) { <form method="POST" action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/************" accept-charset="utf-8"> <----as you can see below this i have name="item_name_"++ this is because i need the item_name_ to go up as we go through this while loop(this is also the same with all of the variables)---> <input type="hidden" name="item_name_"++ value="<?php echo $row['product_id']; ?>"/> <input type="hidden" name="item_quantity_1" value="<?php echo $row['qty']; ?>"/> <input type="hidden" name="item_price_1" value="<?php echo $row['product_price']; ?>"/> <input type="hidden" name="item_currency_1" value="USD"/> <input type="hidden" name="ship_method_name_1" value="UPS Ground"/> <input type="hidden" name="ship_method_price_1" value="10.99"/> <input type="hidden" name="tax_rate" value="0.0875"/> <input type="hidden" name="tax_us_state" value="NY"/> <input type="hidden" name="_charset_"/> <?php } ?> <input type="image" name="Google Checkout" alt="Fast checkout through Google" src="http://checkout.google.com/buttons/checkout.gif?merchant_id=*************&w=180&h=46&style=white&variant=text&loc=en_US" height="46" width="180"/> </form> the image is not even working as a link that is why i think there is a problem Quote Link to comment Share on other sites More sharing options...
haku Posted July 14, 2008 Share Posted July 14, 2008 I think if you gave us even less information, you may get a response. But that was just simply too much information for any one person. Quote Link to comment Share on other sites More sharing options...
Xurion Posted July 14, 2008 Share Posted July 14, 2008 Your script is a mix of PHP and HTML with no <?php or ?> tags. This would cause errors at the most basic level. Quote Link to comment Share on other sites More sharing options...
themistral Posted July 14, 2008 Share Posted July 14, 2008 As haku said, a bit more info would be helpful. However, towards the end of your code you have <?php } ?> At the top of your code you have while($row = mysql_fetch_array($cart_set)) { which then goes into htnl - you haven't closed the php code with ?>. Maybe that's the problem? Quote Link to comment Share on other sites More sharing options...
swissbeets Posted July 14, 2008 Author Share Posted July 14, 2008 sorry about that, i am putting this information into google checkout and need certain things to be posted, i think. i am having a terrible time trying to work with google checkout i am saving all of my information for my cart into a db and only need to query the database and send this info to google when the person clicks submit. i took this fromm the sample and added my own information to it. my problem is i need that to be looped through and post all the information to google, i am assuming that in order for google to tell that they are seperate items, the item number must increment. but i dont know that much html and was hoping i was just making the form do something that was not allowed in html and someone would pretty easily see it. Quote Link to comment Share on other sites More sharing options...
swissbeets Posted July 14, 2008 Author Share Posted July 14, 2008 ok i believe i have the correct code now but for some reason when i click the link, it brings up that i am downloading the picture (the google checkout picture) i cannot figure this out, especially since it worked before i added more items here is my code $cart_set1 = get_cart($cookie_id); while($row = mysql_fetch_array($cart_set1)) {?> <?php $number=1; ?> <form method="POST" action="https://sandbox.google.com/checkout/api/checkout/v2/checkoutForm/Merchant/722419656118816"> <input type="hidden" name="<?php echo "item_name_".$number; ?>" value="<?php echo $row['product_name']; ?>"/> <input type="hidden" name="<?php echo "item_quantity_".$number; ?>" value="<?php echo $row['qty']; ?>"/> <input type="hidden" name="<?php echo "item_price_".$number; ?>" value="<?php echo $row['product_price']; ?>"/> <input type="hidden" name="<?php echo "item_currency_".$number; ?>" value="USD"/> <input type="hidden" name="<?php echo "ship_method_name_".$number; ?>" value="UPS Ground"/> <input type="hidden" name="<?php echo "ship_method_price_".$number; ?>" value="10.99"/> <input type="hidden" name="<?php echo "item_description_".$number; ?>" value="<?php echo $row['size']; ?>"/> <input type="hidden" name="tax_rate" value="0.0875"/> <input type="hidden" name="tax_us_state" value="NY"/> <input type="hidden" name="_charset_"/> <?php $number++; ?> <?php } ?> <input type="image" name="Google Checkout" alt="fast checkout through google" src="http://checkout.google.com/buttons/checkout.gif?merchant_id=722419656118816&w=180&h=46&style=white&variant=text&loc=en_US" height="46" width="180"/> </form any ideas? Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted July 15, 2008 Share Posted July 15, 2008 Just incase you can't get more than one item in this way its caused by your php... $cart_set1 = get_cart($cookie_id); $number=1; while($row = mysql_fetch_array($cart_set1)) {?> <form method="POST" action="https://sandbox.google.com/checkout/api/checkout/v2/checkoutForm/Merchant/722419656118816"> <input type="hidden" name="<?php echo "item_name_".$number; ?>" value="<?php echo $row['product_name']; ?>"/> <input type="hidden" name="<?php echo "item_quantity_".$number; ?>" value="<?php echo $row['qty']; ?>"/> <input type="hidden" name="<?php echo "item_price_".$number; ?>" value="<?php echo $row['product_price']; ?>"/> <input type="hidden" name="<?php echo "item_currency_".$number; ?>" value="USD"/> <input type="hidden" name="<?php echo "ship_method_name_".$number; ?>" value="UPS Ground"/> <input type="hidden" name="<?php echo "ship_method_price_".$number; ?>" value="10.99"/> <input type="hidden" name="<?php echo "item_description_".$number; ?>" value="<?php echo $row['size']; ?>"/> <input type="hidden" name="tax_rate" value="0.0875"/> <input type="hidden" name="tax_us_state" value="NY"/> <input type="hidden" name="_charset_"/> <?php $number++; ?> <?php } ?> <input type="image" name="Google Checkout" alt="fast checkout through google" src="http://checkout.google.com/buttons/checkout.gif?merchant_id=722419656118816&w=180&h=46&style=white&variant=text&loc=en_US" height="46" width="180"/> </form> Quote Link to comment Share on other sites More sharing options...
swissbeets Posted July 16, 2008 Author Share Posted July 16, 2008 got it working thank you very much Quote Link to comment 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.