I'm building a shopping cart, and it needs to be intergrated into another piece of software (not made by me so i can't change how it works).
Basically, when someone clicks 'Buy' on the shopping cart on my site, i need all the information on that shopping cart to be passed to the payment processor made by the other company. They require post information, to be sent in this format:
<input type="hidden" name="item_name_X" value="Item">
<input type="hidden" name="amount_X" value="Price">
This information is required for each individual item, so say someone bought 2 items, the form would have to look like this:
<input type='hidden' name='item_name_1' value='Medium Ceramic Pot' />
<input type='hidden' name='amount_1' value='18.00' />
<input type='hidden' name='item_name_2' value='Small Ceramic Pot' />
<input type='hidden' name='amount_2' value='14.00' />
Notice how the item_name_1 changes to item_name_2 for the second item.
All the information on the items in the cart is collected from this query:
$product_query = "SELECT * FROM `robin_basket` WHERE session_id = '".session_id()."'"; $product_result = mysql_query($product_query); $product_info = mysql_fetch_assoc($product_result);
So i need the form to be automatically generated for each item in the cart, with the item_name and amount incrementing by 1 for each new item.
Hope you understand, if you don't just tell me which bit you need clarification on (would really like to get this sorted).