Member
Member
timfl   2008-10-27, 21:28
#1

Can someone help me parse this paragraph?

Quote:Price lists can also be passed as a parameter to the GoogleCheckout() function. See also GoogleCheckoutPricelistFromString() for parsing a string into the pricelist array. This could be used, for instance, by storing a pricelist string in the 'customdata' field of your images and then parsing and passing it in the GoogleCheckout() call. This would give you individual pricing by image.
I tried, but failed, numerous times to get this working. In the custom data field for my image I entered:

Quote:20x20:canvas=400.00 30x30:canvas=600
Then there's this:

Quote:function GoogleCheckoutPricelistFromString($prices) {
$pricelist = array();
$pricelistelements = explode(' ', $prices);
foreach ($pricelistelements as $element) {
if (!empty($element)) {
$elementparts = explode('=', $element);
$pricelist[$elementparts[0]] = $elementparts[1];
}
}
return $pricelist;
}
Where do I insert this code? Sorry, I'm just a scripting dummy.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.