Hi, I just managed to integrate nopcart, a php shopping cart into zenphoto, a test version is up at www.bertsimons.nl/zenphototest and if you go to collectionś/zonnebrillen you can see under each image the order choices and the add to shopping cart button, in the pages menu list theré is a shopping cart page which lists all the items you did add
in the admin tab I use the image Place/Location/State/Country fields to set the arrays of avalaible choices
like Price/size/color/ordernumber as 40/S,L,XL/green,red,blue/SB12345 on the image page the exploded arrays fill up the nopcart selection menus and dropdown menus.
this seems to work flawlessly..
So here is the thing.. I use the image fields for lot of other things on sites I make, sometims for their original purpose but sometimes for other actions like in this cart..
Long time ago, before I knew zenphoto I used Pixelpost, they had a add field oiption in their admin..What I would like to get on the admin page is this too:
a button ´add field´: if clicked asks for a name of the field eg ´color´ and then automatic adds this field on the images admin tab, creates a db base field for this entry and automatic creates a function called getImageColor() or getImagePrice() etc..
Could this be done? any thoughts on how to approach this?
Sounds interessting. Hopefully as a plugin this time...;-) Btw, that site still runs 1.2.5 RC1....?
We don't have an "add field" but take a look at the filter-custom_data.php plugin that provides an example to use the custom data field similar ways. You will probably need to make your own filter plugin for this.
I have not tried that plugin myself yet I have to admit.
my server has only MySQL version 3.23.58... I tried to upgrade last week but when running zenphoto it was blank and showed missing collums reports...spend quitte sometime downgrading and restoring the database (the one I backed up in phpmyadmin the backup plugin restore reported a failure..)
but when my licens ends in december my provider will put me on a new server..
I looked into the plugin structure tutorial.. for the twitter thing a month ago but got lost..I still strugle sometimes with the easy things let apart the Higher Coding stuff..but with some patience I could get it done I guess..
i will look into the filter-custom_data.php tomoorow!
ps the working shopping cart is now hosted on www.sugarbelly.nl
I'll comeback to you concerning turning it into a plugin.. but as of thismoment I still have no clue how to implement the custom datafilter as explained by sbillard inthis thread..http://www.zenphoto.org/support/topic.php?id=6555#post-41764