Hi I would like to be able to let a customer look at images in the gallery image module. When the customer sees an image they like, I would like to make it possible for them to press a "buy" button that opens a form. I need a little bit of direction about the database queries and how to make this happen.
Can anybody point me in the right direction?
I'll clarify a bit. I want to sell prints of pictures not downloads. Because of this I need to make a dynamic form that can add more than one instance of the same picture in the form; in case the customer want to buy diffent sizes and qualities. After the client is done with the first picture it should be possible to continue to add more orders to the form of other pictures.
My site is not up yet and this is an important feature for me since I want my clients to be able to chose not only which pictures to buy but also what print quality.
It is also important because with the help of a form I can submit the order directly to the company that prints. Instead of manually handle every order. Also this would make it possible for me to let the printing company handle the delivery to my clients which reduces handling for me.
I am running Joomla 1.6.1 and I have the latest phoca installed. It is also important for me to understand what's going on. Because of this I would like to build as much as possible myself (without making it an overkill)
Viktor
Form linked to gallery image module
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Form linked to gallery image module
Hi, no experiences for now yet, in Joomla! 1.5 maybe the possible solution can be:
https://www.phoca.cz/documents/2-phoca-g ... ntegration
Jan
https://www.phoca.cz/documents/2-phoca-g ... ntegration
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 31 Mar 2011, 16:40
Re: Form linked to gallery image module
Hi again,
Currently I am evaluating Smartformer which seems like a good choice for my requirements, since PHP, HTML and other code can be implemented in all items in the form. I don't know for sure if I'll use it though. Time will tell. If I manage to make a good implementation of it. I can post a demo user here later. If someone is interested that is? As for Phocagallery I think it is very good and I will put my money where my mouth is to support your project.
My biggest problem now is learning how to query the database, but I am getting there slowly.
Viktor
Currently I am evaluating Smartformer which seems like a good choice for my requirements, since PHP, HTML and other code can be implemented in all items in the form. I don't know for sure if I'll use it though. Time will tell. If I manage to make a good implementation of it. I can post a demo user here later. If someone is interested that is? As for Phocagallery I think it is very good and I will put my money where my mouth is to support your project.
My biggest problem now is learning how to query the database, but I am getting there slowly.
Viktor
-
- Phoca Newbie
- Posts: 5
- Joined: 31 Mar 2011, 16:40
Re: Form linked to gallery image module
Hi again,
I am having trouble getting the category id for the logged in user.
So far I have managed to pull the user id by:
global $my;
$my =& JFactory::getUser();
if (isset ($my->id)) echo $my->id;
However getting from there to pulling the category id seems difficult since I am having trouble passing the $my->id to a variable. Like I said I am a real noob. Can somebody explain what "->" means I've googled it without luck.
And also like I stated above I need the category id for the logged in user in order to pull images related to that user from the database in to the form.
Viktor
I am having trouble getting the category id for the logged in user.
So far I have managed to pull the user id by:
global $my;
$my =& JFactory::getUser();
if (isset ($my->id)) echo $my->id;
However getting from there to pulling the category id seems difficult since I am having trouble passing the $my->id to a variable. Like I said I am a real noob. Can somebody explain what "->" means I've googled it without luck.
And also like I stated above I need the category id for the logged in user in order to pull images related to that user from the database in to the form.
Viktor
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Form linked to gallery image module
Hi, maybe this is more a question on Joomla.org forum maybe on PHP forum (-> to know what is object oriented php code)
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 31 Mar 2011, 16:40
Re: Form linked to gallery image module
Hi again thanks for the explanation and yes this may be more a question for another type of forum.
If somebody else need to make similar queries for registered user ACL level pictures together with forms this code can get you there.
$my=& JFactory::getUser();
$db=& JFactory::getDBO();
$a=& $my->id;
$query="SELECT id FROM jos_phocagallery_categories WHERE accessuserid='$a'";
$db->setQuery($query);
$r=$db->loadResult();
$queryc="SELECT filename FROM jos_phocagallery WHERE catid='$r'";
$db->setQuery($queryc);
$results=$db->loadResultArray();
The $results variable, in this case contains the filenames stored in Phocagallery for a specific category ACL level.
I hope you don't mind - Jan
Regards / Viktor
PS I still think your application is great and I will most likely use it on my site for the better looking parts and for image handling. DS
If somebody else need to make similar queries for registered user ACL level pictures together with forms this code can get you there.
$my=& JFactory::getUser();
$db=& JFactory::getDBO();
$a=& $my->id;
$query="SELECT id FROM jos_phocagallery_categories WHERE accessuserid='$a'";
$db->setQuery($query);
$r=$db->loadResult();
$queryc="SELECT filename FROM jos_phocagallery WHERE catid='$r'";
$db->setQuery($queryc);
$results=$db->loadResultArray();
The $results variable, in this case contains the filenames stored in Phocagallery for a specific category ACL level.
I hope you don't mind - Jan
Regards / Viktor
PS I still think your application is great and I will most likely use it on my site for the better looking parts and for image handling. DS
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Form linked to gallery image module
Hi, thank you for the guide.
Jan
Jan
If you find Phoca extensions useful, please support the project