I'm using the phoca gallery with the simple caddy shopping cart on a web site where people need to have the option of buying prints of the photos. Everything works as it should, but the web site is for an entertainment company that employs a large number of freelance photographers and it's just not practical to have to edit the description of each image with the plug in tags.
Is it possible to place the add to cart button automatically when images are uploaded?
Or some sort of work around where the simple caddy tag is automatically added to the description when images are uploaded?
I would really appreciate any help or guidance in the right direction.
Thank you.
phoca gallery and simple caddy automatic button
-
steve22
- Phoca Newbie

- Posts: 5
- Joined: 10 Jun 2010, 01:35
- Jan
- Phoca Hero

- Posts: 49299
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: phoca gallery and simple caddy automatic button
Hi, I think this needs to be customized in the code. There is no problem to set the plugin code as default in description of Phoca Gallery, the problem is creating some behaviour which will add the ID of simple caddy product 
If you find Phoca extensions useful, please support the project
-
steve22
- Phoca Newbie

- Posts: 5
- Joined: 10 Jun 2010, 01:35
Re: phoca gallery and simple caddy automatic button
as a somewhat of a solution I edited the components/_com_phocagallery/views/user/tmpl/default_images.php file.
In the code where it specifies the value for the text box input I simply added the simple caddy codes
This way as soon as the edit picture screen is opened the needed code is automatically placed in the description. It's still not what I really need since I still have to at least open and save each picture but I suppose it is a step forward. In case someone else needs a function similar to mine.
Code:
<textarea id="phocagallery-upload-description" name="phocagalleryuploaddescription" onkeyup="countCharsUpload();" cols="30" rows="10" class="comment-input"><?php echo $this->tmpl['imageedit']->description; ?>
{simplecaddy code=Digital picname=<?php echo $this->tmpl['imageedit']->title ?>}
{simplecaddy code=Print picname=<?php echo $this->tmpl['imageedit']->title ?>}
</textarea>
Anyone know of a way to automatically add this to the phoca gallery description when the image is initially uploaded?
In the code where it specifies the value for the text box input I simply added the simple caddy codes
This way as soon as the edit picture screen is opened the needed code is automatically placed in the description. It's still not what I really need since I still have to at least open and save each picture but I suppose it is a step forward. In case someone else needs a function similar to mine.
Code:
<textarea id="phocagallery-upload-description" name="phocagalleryuploaddescription" onkeyup="countCharsUpload();" cols="30" rows="10" class="comment-input"><?php echo $this->tmpl['imageedit']->description; ?>
{simplecaddy code=Digital picname=<?php echo $this->tmpl['imageedit']->title ?>}
{simplecaddy code=Print picname=<?php echo $this->tmpl['imageedit']->title ?>}
</textarea>
Anyone know of a way to automatically add this to the phoca gallery description when the image is initially uploaded?
- Jan
- Phoca Hero

- Posts: 49299
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: phoca gallery and simple caddy automatic button
Hi, you need to customize saving images to database, but the problem is how should the script know which product id should be added.
See models for image and multiple add
administrator/components/com_phocagallery/models/phocagallery
administrator/components/com_phocagallery/models/phocagallerys
administrator/components/com_phocagallery/models/phocagallerym
Jan
See models for image and multiple add
administrator/components/com_phocagallery/models/phocagallery
administrator/components/com_phocagallery/models/phocagallerys
administrator/components/com_phocagallery/models/phocagallerym
Jan
If you find Phoca extensions useful, please support the project
-
louis
- Phoca Newbie

- Posts: 5
- Joined: 14 Apr 2010, 16:48
- Location: Netherlands
- Contact:
Re: phoca gallery and simple caddy automatic button
TS, perhaps this is a helpful component? Let me know what you think..
- Jan
- Phoca Hero

- Posts: 49299
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: phoca gallery and simple caddy automatic button
Great to hear it, there is such component with such features.
Marked as improvement.
Jan
Marked as improvement.
Jan
If you find Phoca extensions useful, please support the project
-
steve22
- Phoca Newbie

- Posts: 5
- Joined: 10 Jun 2010, 01:35
Re: phoca gallery and simple caddy automatic button
Thank you for the advice, I will look at the model files and post if I find a solution.
When saving images to the database I don't think you need to worry about a product ID, since it's generated automatically according to the image title. The way simple caddy is set up is you create a general base code or for the purpose of this conversation the product ID.
So in my case the product ID is "digital". When a person wants to buy that picture it tells simple caddy they just want the digital copy (no prints) and charges them accordingly. I suppose the "product ID" Is actually static. The difference is the image ID (name). This way i know exactly which image a customer wants.
When editing how the images are added to the database all i need is to insert a description with each image and the dynamic part of the description is the image ID which can be taken right off the ID field in the database right?
Basically if I can add an automated description that has the code below I will be all set.
{simplecaddy code=Digital picname=<?php echo $this->tmpl['imageedit']->title ?>}
{simplecaddy code=Print picname=<?php echo $this->tmpl['imageedit']->title ?
As far as this plug in goes I'm not sure it's needed. Latest Phoca Gallery integrates extremely easy with the latest Simple caddy. The only thing missing is adding the description automatically (which is exactly what I need done) But I'm not sure I like the idea of having each image as a product. Since there will be 1000's of pictures it would just clutter the simple caddy products navigation. But the function of adding descriptions in one click is a useful one, I'll see if I can isolate it and just use that part to add the needed descriptions.
I suppose a manual SQL query will do the job but it's a rather crude way of solving things now days
Again thank you for all the advice and participation
When saving images to the database I don't think you need to worry about a product ID, since it's generated automatically according to the image title. The way simple caddy is set up is you create a general base code or for the purpose of this conversation the product ID.
So in my case the product ID is "digital". When a person wants to buy that picture it tells simple caddy they just want the digital copy (no prints) and charges them accordingly. I suppose the "product ID" Is actually static. The difference is the image ID (name). This way i know exactly which image a customer wants.
When editing how the images are added to the database all i need is to insert a description with each image and the dynamic part of the description is the image ID which can be taken right off the ID field in the database right?
Basically if I can add an automated description that has the code below I will be all set.
{simplecaddy code=Digital picname=<?php echo $this->tmpl['imageedit']->title ?>}
{simplecaddy code=Print picname=<?php echo $this->tmpl['imageedit']->title ?
As far as this plug in goes I'm not sure it's needed. Latest Phoca Gallery integrates extremely easy with the latest Simple caddy. The only thing missing is adding the description automatically (which is exactly what I need done) But I'm not sure I like the idea of having each image as a product. Since there will be 1000's of pictures it would just clutter the simple caddy products navigation. But the function of adding descriptions in one click is a useful one, I'll see if I can isolate it and just use that part to add the needed descriptions.
I suppose a manual SQL query will do the job but it's a rather crude way of solving things now days
Again thank you for all the advice and participation
-
louis
- Phoca Newbie

- Posts: 5
- Joined: 14 Apr 2010, 16:48
- Location: Netherlands
- Contact:
Re: phoca gallery and simple caddy automatic button
So if I where to create an additional option where you can disable product generation, the component would be useful? Because I think that's fairly easy to accomplish.
I guess that would leave you with a selection box to select a preconfigured SimpleCaddy product and a textfield called code (already present).The 'code' field allows you to define a template code that will be submitted to the image description fields and could look something like:
{simplecaddy code=#CODE# picname=#IMG#}
Where #CODE# and #IMG# get replaced by the SimpleCaddy product code and the image name.
The only requirement for this to be useful would be that you have some code in place to handle the picname attribute on ordered images, right?
@Jan
And now it can also be found in the Joomla! Extension Directory
I guess that would leave you with a selection box to select a preconfigured SimpleCaddy product and a textfield called code (already present).The 'code' field allows you to define a template code that will be submitted to the image description fields and could look something like:
{simplecaddy code=#CODE# picname=#IMG#}
Where #CODE# and #IMG# get replaced by the SimpleCaddy product code and the image name.
The only requirement for this to be useful would be that you have some code in place to handle the picname attribute on ordered images, right?
@Jan
Great to hear it, there is such component with such features.
And now it can also be found in the Joomla! Extension Directory
-
louis
- Phoca Newbie

- Posts: 5
- Joined: 14 Apr 2010, 16:48
- Location: Netherlands
- Contact:
Re: phoca gallery and simple caddy automatic button
Just a minor update on this discussion. Since it required only minor changes, the extension now has the required functionality: one push of the button enables you to link multiple images to a SimpleCaddy product without creating additional products. Have fun with it!
- Jan
- Phoca Hero

- Posts: 49299
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: phoca gallery and simple caddy automatic button
Hi, great to hear, it is on JED. Thank you for the info.
Jan
Jan
If you find Phoca extensions useful, please support the project