Managed to integrate this plug-in fairly easily as a thickbox but I wondered if anyone would be kind enough to help with my struggles.
What I am ideally looking for, is a set of radio buttons that take their values from the customdata field. The customer then just selects the size and finish from the options and presses the Buy Now button.
Options would be, for example:
6x4 Glossy 5.00
8x10 Glossy 10.00
22x18 Canvas 85.00
My knowledge of php is very limited and the documentation on the site seems to be geared towards developers rather than photographers, so I would appreciate examples that I can play with to get the desired result.
Thanks in advance
The Paypal plugin uses a selection drop-down to select the item/price. You would really have to learn PHP if you want to change that to radio buttons. However, if all you want is to have different pricing options based on the image there is a much simpler solution. (You will still have to write some PHP, though.)
The documentation for the plugin is here: http://www.zenphoto.org/documentation/zenphoto/_plugins---zenPaypal.php.html
You can put your 'price list' into the custom data field of the image and pass it on to the paypal button using the zenPaypalPricelistFromString() function to convert it from a string of prices to the array of prices that zenPaypal() requires. See the function definition for the format of the pricelist string.
Thanks for the reply.
One of the biggest draw backs I can see with the drop-downs is that it doesn't display the price until after the visitor has clicked to go to PayPal. If that could be accomplished that would go some way to mitigating the lack of radio buttons.
I have read the documentation but I am struggling to understand it due to my lack of php knowledge. My best guess is that I need a statement such as:
zenPaypalPricelistFromString(getCustomData())
Am I close?
Thanks
Tonight's build will have a new function--zenPaypalPrintPricelist() this will create a link on your image page. Clicking on the link will expose a price list table.
DrSlony: We have such a field, it is called custom_data. The zenPaypal documentation will tell you the format for the string and how to pass it to the zenPaypal() function. (And now the zenPaypalPrintPricelist() function as well.)
The only theme which has zenPaypal included is the example theme [because it is an example....] I suggest you use the following code for accomplishing what you describe:
`$prices = getCustomData();
if (!empty($prices)) {
$pricelist = zenPaypalPricelistFromString($prices);
zenPaypal($pricelist);
}`
Just to provide an update for this. I wanted to use PayPal's shopping cart feature rather than it's single-item buy function, so I edited the code in zenPaypal.php. I followed these instructions from the paypal site;
https://www.paypal.com/us/cgi-bin/webscr?cmd=_pdn_xclick_to_cart_outside
Perhaps there could be an option in the administrator panel to switch between these modes?
Perhaps you could create a ticket and attach your modified code. If you do I will look at making the mode an options. (Or perhaps the default as we did on Google Checkout.) Depends on if anyone really wants to stick with the current mode if checkout mode is available.