1

The google checkout api guide gives this example with 1 item and 2 shipping options:

<input type="hidden" name="item_name_1" value="5 lbs. Dog Food"/>
<input type="hidden" name="item_description_1"
  value="5 lb. bag of nutritious Dog Food"/>
<input type="hidden" name="item_price_1" value="35.00"/>
<input type="hidden" name="item_currency_1" value="USD"/>
<input type="hidden" name="item_quantity_1" value="1"/>
<input type="hidden" name="item_merchant_id_1" value="5LBDOGCHOW"/>

// shipping options irrelevant here

(I may be wrong in thinking:) Because I have a custom cart, I have to generate this form with my cart and display it to the user with a checkout button.

If I have multiple items in the cart, would the correct way of sending this to google be like this:

<input type="hidden" name="item_name_#" value="5 lbs. Dog Food"/>
<input type="hidden" name="item_description_#"
  value="5 lb. bag of nutritious Dog Food"/>
<input type="hidden" name="item_price_#" value="35.00"/>
<input type="hidden" name="item_currency_#" value="USD"/>
<input type="hidden" name="item_quantity_#" value="1"/>
<input type="hidden" name="item_merchant_id_#" value="XXXXXX"/>

Where # is the count of each item in the cart (item_name_1, item_name_2, etc)?

If that's incorrect how do I generate the checkout form with multiple items?

Ozzy
  • 8,244
  • 7
  • 55
  • 95

1 Answers1

1

Looks good to me (of course the name, description, price, etc. are also going to be variables)

<input type="hidden" name="item_name_#" value="#foo#"/>
Toon Krijthe
  • 52,876
  • 38
  • 145
  • 202
EdSF
  • 11,753
  • 6
  • 42
  • 83
  • I'm sorry if this is a dumb question! Just to be clear, 'looks good' means that is correct or you **think** its correct? – Ozzy Jun 02 '12 at 16:06
  • 1
    It's correct. "Looks good" - because the above is just part of what you need (the part you marked irrelevant, etc.) so it's best you do [sandbox testing](https://developers.google.com/checkout/developer/Google_Checkout_Basic_HTML_Sandbox) to see if everything works as you expect (not just the above part). – EdSF Jun 02 '12 at 16:12