ZenphotoCMS Forum
Individual pricing with Google Checkout - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Individual pricing with Google Checkout (/thread-3950.html)



Individual pricing with Google Checkout - timfl - 2008-10-27

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.