ZenphotoCMS Forum
Making Paypal checkout work correctly - 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: Making Paypal checkout work correctly (/thread-4663.html)

Pages: 1 2


Making Paypal checkout work correctly - Oakey22 - 2009-02-09

What i would like to do is set prices for individual albums and photo's with paypal plugin. I have put this code into image.php

'$prices = getImageCustomData();
if (!empty($prices)) {
$pricelist = zenPaypalPricelistFromString($prices);
zenPaypal($pricelist);
}'

This then loads the data from the Custom Data and puts it in the drop down menu but it does not show a new Price list only the default one i set in admin toolbox.

Also i cant get it to add the checkout to an entire folder only individual photo's. What am i doing wrong?

My website for testing is http://www.2photo.co.uk/zenphoto




Making Paypal checkout work correctly - sbillard - 2009-02-09

I am not sure I am following you. To have any pricelist show you need to set the second parameter to zenPaypal() to true. Since it is not so set there would be no pricelist link displayed.

I visited your site, but did not see any Paypal ordering items.




Making Paypal checkout work correctly - Oakey22 - 2009-02-10

here is the one that is with custom data
http://www.2photo.co.uk/zenphoto/index.php?album=Gallery%2FFootball%2FGresley+Rovers+vs+Lincoln+United&image=0010.jpg

but when i get the custom data working in the price it does not print the new pricelist with the data from the custom data only the default i put in when i was setting up zenpaypal in the admin plugin options.

If i put zenpaypal() instead of

$prices = getImageCustomData();
if (!empty($prices)) {
$pricelist = zenPaypalPricelistFromString($prices);
zenPaypal($pricelist);
}

the custom data is not used but the zenpaypal() works on every image but at the same prices.




Making Paypal checkout work correctly - gwmbox - 2009-02-10

Can you post an example of the Custom data you are using?

The reason I ask is that from my limited knowledge of php you are still asking for the standard paypal price list(zenPaypal($pricelist) and hence that is what you are getting.

I abandoned the use of this plugin myself and went with a third party cart system built into ZP, however I am interested to watch and read about how this paypal (and other payment systems) get integrated better into ZP.




Making Paypal checkout work correctly - Oakey22 - 2009-02-10

the custom data is 10x15:glossy=5.00 which works on the price list that is a drop down menu but does not print this info on my page so you can see it all the time.




Making Paypal checkout work correctly - Oakey22 - 2009-02-10

Got the individual price list now working,
cheanged the zenpaypal.php to this from

Can i add custom data for an album so it applies the prices to all pics in that album instead of doing each picture at a time?

Thanks
Ian




Making Paypal checkout work correctly - sbillard - 2009-02-10

I'll get your fix into the nightly build tonight. Thanks.

Sorry, there is no mass-edit for images. You could do that with an SQL query, though. There is probably an SQL management tool on your site such as phpMyAdmin.




Making Paypal checkout work correctly - acrylian - 2009-02-10

If you really want all images in one album to have the same pricelist you could use the album custom data the same way as the image one.




Making Paypal checkout work correctly - Oakey22 - 2009-02-10

acrylian, i did do that but it does not display anything when i do that. no paypal buttons or anything.




Making Paypal checkout work correctly - sbillard - 2009-02-11

If nothing is displaying, usually there is some kind of error occurring. What was your code to use the album custom data?




Making Paypal checkout work correctly - Oakey22 - 2009-02-11

The only code i put into image.php is
$prices = getImageCustomData();
if (!empty($prices)) {
$pricelist = zenPaypalPricelistFromString($prices);
zenPaypal($pricelist);
}

do i need to put something else to make it check for album cutom data?

sorry for sounding thick but i hae never dealt with php before.

Ian




Making Paypal checkout work correctly - acrylian - 2009-02-11

It should work if you add the price list to the album custom field and then use `http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetAlbumCustomData instead of the image one.

Note I never used the paypal plugin nor am I familiar with it at all.




Making Paypal checkout work correctly - Oakey22 - 2009-02-11

What code would i put in if i wanted it to check to see if the image custom data is empty, then if it is empty use the album data?




Making Paypal checkout work correctly - acrylian - 2009-02-11

Maybe http://www.php.net/manual/en/function.empty.php




Making Paypal checkout work correctly - pischla - 2009-05-29

Hi!
Thought I would share my lines of code that I put in image.php to get "getImageCustomData" and "getAlbumCustomData" to work together:

`

`
Took me a while to realize that I had to remove ";" after if empty to get it working...

regards, pischla




Making Paypal checkout work correctly - pischla - 2009-05-29

Here's a refined code that hides the paypal function if there are no prices for an album or image:

`

`
/pischla




Making Paypal checkout work correctly - lainyrache - 2010-05-13

I would also like to set individual pricing for images in albums. But I am having trouble implimenting it.
Paypal plugin installed fine. Super in fact. I also got the Nopaypal option working no problem. Insrtructions were very clear.
However when i try the last two blocks of code above in image.php. It doesn't work.
Can someone help confirm I have the following correct.
1.Add to image.php

or add

  1. Add to options>plugins> zenpaypal > the pricelist field eg
    4x6aper Matte Thin=5.75|8x10:Xtrem Glossy=20.00|11x14aper=15.35

3.Add to album> choose gallery > choose images tab > paste in Special data field - the different pricelist eg
20x30aper Matte Thin=5.75|8x10:Xtrem Glossy=50.00
is that correct formatting for the Special data field??

Fatal error: Call to undefined function zenpaypalpricelistfromstring() in /home/public_html/gal2/themes/mytheme/image.php on line 77

Can anyone see what i missed or i am doing wrong.
Many thanks for any guidance.




Making Paypal checkout work correctly - lainyrache - 2010-05-28

Hi
Has anyone got multiple price lists working on the paypal plugin?
Or have I misinterpreted the features built in?
I followed instructions as far as I could,I have been through plugin help plus checked instructions on all relevant forum posts. I am still getting the following error.
Fatal error: Call to undefined function zenpaypalpricelistfromstring() in /home/public_html/gal2/themes/mytheme/image.php on line 77
I inserted data in the image special/custom data field.
Any guidance really appreciated.




Making Paypal checkout work correctly - kagutsuchi - 2010-05-28

The plugin's function names have changed since these older posts (a year old!). I haven't used this plugin, but I believe you should be able to change zenPaypalPricelistFromString() with getZenPayPalPriceList() to get it to work.




Making Paypal checkout work correctly - lainyrache - 2010-06-07

Hi kagutsuchi

Thank you for the reply. I tried this and it has removed the error which is a step in the right direction... but still no joy getting it all working. No change in status. The default payment list still displays.
Any other guidance much appreciated
cheers
e