forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Selling pictures => Topic started by: Casper on July 04, 2004, 07:02:38 pm

Title: add a Paypal shopping basket to your gallery.
Post by: Casper on July 04, 2004, 07:02:38 pm
Completely updated, 12/9/04
Version for coppermine 1.4x attached to this post http://forum.coppermine-gallery.net/index.php?topic=19491.msg120378#msg120378

These is a mod that allow coppermine to use paypals shopping basket.

You can see a demo of this mod, and download the files HERE (http://www.picture-parade.co.uk/shop/index.php)

The updated mod uses just 1 line with dropdown boxes for all choices (up to 20 price options), and does this using javascript.  The original mod, which used a new line for each price option, is still available for download from the demo.  It has a neater basket, but has a maximum of 6 price options.

You can also download the files from the downloads section here.

There are easy to follow instructions included in the docs folder of the downloads. All that is required to convert a standard gallery is to use the enclosed files to overwrite the standard files, then run update.

The mod included sets all albums in the gallery to display exactly the same options with every image, but if you want to have different options available in different albums, the instructions are attached to this post, as complex_shop.txt.  This does require some code changes, but all is explained.


Please note, most of this thread is about earlier versions of the shop hack.  This post, and any after and including this one (http://forum.coppermine-gallery.net/index.php?topic=8703.msg47216#msg47216), are about this current, easy to apply hack.

You may find some helpful info and tips on the other posts though.

[attachment deleted by admin]
Title: Re: MOD. add a Paypal shopping basket to your gallery.
Post by: omniscientdeveloper on July 04, 2004, 07:06:12 pm
No code?  :o

I was actually going to do this next! LOL  ;D
Sweet! Now, I don't have to!


-omni
Title: Re: MOD. add a Paypal shopping basket to your gallery.
Post by: Casper on July 04, 2004, 07:10:02 pm
You were quick.  I'd hoped nobody had noticed  ;D
Title: Re: MOD. add a Paypal shopping basket to your gallery.
Post by: omniscientdeveloper on July 04, 2004, 07:17:17 pm
I actually didn't know that you had "just" posted the thread. I just caught the title when I did a refresh.  ;)


-omni
Title: Re: MOD. add a Paypal shopping basket to your gallery.
Post by: Tarique Sani on July 05, 2004, 07:08:23 am
Great work Casper!!!
Title: Re: MOD[1.3x]. add a Paypal shopping basket to your gallery.
Post by: Casper on July 05, 2004, 06:29:54 pm
I have now added the mod that allows different buttons in different albums/categories.
It is attached to the first post, as 'complexshop.txt'.
If you want to view my test shop, I will leave it for viewing for a few weeks.  It is Here (http://www.picture-parade.co.uk/shop/index.php)
Please feel free to use the buttons, BUT, don't checkout, it's not a real shop.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 05, 2004, 10:52:47 pm
I've just updated the to instruction files, on the first post, to create a cleaner interface for the admin upload and edit areas.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Incite on July 06, 2004, 11:56:42 pm
I'm still working with 1.2.1, would this Hack work?
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 07, 2004, 12:03:09 am
I think so, and can think of no reason why notbut not tested.  I no longer have a 1.2.1 install to test on

Please remember to backup your files before trying, so if it doesn't you can return.

Also, please let us know the result.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Joel on July 08, 2004, 05:17:11 pm
Hi,

great work Casper!
I tried to do it on my own, but since I'm no coder it takes me three days  - and after it was done, I found your posting in here >:(

My solution looks like this:
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fweb.no-nameweb.de%2Fshop%2Fpaypal1.jpg&hash=829daf3c885524161c140a191fb4401a1d9e7da1)


After clicking on the link "Like to buy?" this shows up
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fweb.no-nameweb.de%2Fshop%2Fpaypal2.jpg&hash=7ffb22a922d76b7e26d4942d0c3a87c14e1afde2)

The paypal-basket:
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fweb.no-nameweb.de%2Fshop%2Fpaypal31.jpg&hash=d73a9839b7c8b02b7ec692a99e605f950b3ed55e)
The shown URL to my site (not online yet) is wiped out by purpose.

As you might notice: all of this pics don't have a "titel" - how its called in the original template - 'cause I don't want them named like "Fish 1", "Fish 2" or "Seahorse laying", "Seahorse swimming" or so. Only a description.
So for clear identifying the pic in the Paypal-basket the (p)ID (or the filename) and the URL of the picture will show up.


Because my solution is not very professional made: is there a chance to put it your way, but with getting an unique identifier in the Paypal-basket?

Thanks a lot,

Joel



Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 08, 2004, 07:56:49 pm
Hi Joel,

First, I dont think your method looks unprofessional. 
I don't know exactly how you achieved your way of getting your buttons to get the info, so I'm not sure how easy/hard it is for you.
I looked at your pics, and had a look at how you could use my method to have more than one button per pic.
I found I could only do this if all the items in the album were the same price, which is probable with a photo seller, so I tried to get your layout.

I made the 3 buttons, (basically all the same except the price), and I replaced the item name line in the button code, with the following, just changing the size attribute for each button.;
Code: [Select]
<input type="hidden" name="item_name" value="{TITLE},size 130 x 178">
I then entered the pic name into the edit pics, showing the pic name and picture ID(not coppermine ID, but this may be possible), like this;
Quote
Angelfish, (pic ID 123)

This resulted in the following pages (note, I am just using the classic theme, and have not spent time formatting the layout, so it doesn't look as good as yours);


[attachment deleted by admin]
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Joel on July 08, 2004, 09:55:27 pm
Hi Casper,

Hi Joel,

First, I dont think your method looks unprofessional. 

Thanks a lot for that and your quick reply -  I meant the way I put the code together ;)
What annoys me most at the moment is the back_link from Paypal (continue shopping) - since the referer is "pay.php" potential customers are not taken back to my gallery directly.

I don't know exactly how you achieved your way of getting your buttons to get the info, so I'm not sure how easy/hard it is for you.

There is nothing to hide: in displayimage.php (theme: hardwired) within "function html_picture()" around line 192 (means at the end of the block) I put this
Code: [Select]
$pic_html .= "</a><a href=pay.php?id=$pid&pic=$foto&path=$path_to_pic><font size= 3> Like to buy? - Kaufen?</font></a>\n";

and defined my vars at the begining of that block - not necessary, but the URL to passover the vars will be shorter :
Code: [Select]
$foto = $CURRENT_PIC_DATA['filename'];
$path_to_pic = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'];

pay.php has a very normal style: some tables and the usual "forms" and "input type" stuff, like it will be generated on the Paypal-site and you described it in  your hack, too...
I just grab the vars:
Code: [Select]
<input type="hidden" name="item_number" value="130 x 178 mm of PictureID=<?php echo htmlspecialchars($_REQUEST['id']); ?>" />
I looked at your pics, and had a look at how you could use my method to have more than one button per pic.
...
Thanks again for you help. I will try out this.

Joel
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: snowball7g on July 22, 2004, 10:27:33 pm
Hi to all,

i have a similar problem. i try to find a way to submit the current image name (ex. img0001.jpg) by link to a shopping basket on another server. I placed a link to add to shopping basket in the theme.php right under the image. you can see at www.sc-onstmettingen.de.
But the main thing is missing the name of the current shown picture!!!
is there a variable like {image_name} or something else.

I'm sure it is easy for prof. users but it's a big problem for me as an coppermine newbie

Thanks for your help
snowball7g
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: yoshikiwei on July 23, 2004, 06:06:39 am
haven tried on this hack but was wondering if this hack can work as a online printing service too ?
like those in webshots.com ??

just wondering  ;)
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Tarique Sani on July 23, 2004, 07:04:46 am
You can get the URL of the current picture in displayimage.php by using the following

$picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');

Substitute normal for 'full' and 'thumb' to get URLs to fullsize and thumb respectively
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 23, 2004, 09:36:38 am
I have done a complete rework of this hack, specifically for the sale of photo prints, and it comes as a complete package, where you just drop in the new files, and run update.php.
The prices and print sizes available etc are entered in config, and stored on the db.  There are no files for the user to edit other than any custom theme.

I have done this with all the standard themes, plus Tariques 2 themes (hope that's ok Tarique), and you can see it as a working demo here. (http://www.picture-parade.co.uk/shop/index.php) 

I am away for the weekend, leaving soon, so don't have time to post the instructions now, but will do so on Monday.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: yoshikiwei on July 23, 2004, 10:07:10 am
Thanks casper
looking forward to your instructions on the new hack  ;D
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: pinguish on July 23, 2004, 12:25:37 pm
lol spent weeks working on this as well..will wait to see your download and compare against my amateur method :)

yours look (as usual) very slick...
what kind of control have you got over the pricing of each image/gallery with this 'print shop' version?
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 26, 2004, 06:44:57 pm
I have spent today adding currency selection to config, and updating ready for version 1.3.2.

The instructions for how to use this hack are available Here (http://www.hsocuk.com/shop/docs/shop.html), and also within the docs folder of the download.

The demo is available Here (http://www.hsocuk.com/shop/)

Download the shop-update.zip, and your choice of theme/s, from Here (http://www.hsocuk.com/shop/thumbnails.php?album=3) and just follow the instructions.  There are no files to be edited, other than any custom themes, or language files if you want more than English.  Note, do not use the paypal buttons to buy these downloads, they are free.  Just click on the file and download.

Sizes, prices and currency are all now set in config.

This hack has the same prices and sizes on each album, but it won't be too difficult to make it show different prices on different albums/categories, but this will require code changes by the user.

Hope you like it.

@Gaugau, some of these files are too big to attach here.  I would prefer to have them on this site, how should I do it?
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on July 27, 2004, 08:29:54 am
zip the whole enchilada up and send it to me by email (make sure to user a good subject line, or my spam filter will eat your email). I'll then upload it to the files section.

GauGau

P.S. did you try to attach a zip?
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 27, 2004, 12:38:56 pm
Hi Gaugau,

yes they are all zipped, but the mod files, complete with instructions and images, are 331kb, and each theme folder comes at between 117 and 126kb.

Will email them to you shortly.

For those interested in having different prices in different albums, I have set up the demo to show what can be done with a little bit of code changing.
There are now 3 categories, each with a different setup.  See it HERE (http://www.hsocuk.com/shop/index.php)
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: big nose on July 27, 2004, 05:00:50 pm
Hi Casper

All looks very good, Ive just setup a new gallary for some of my clients and this paypal mod is just what i have been looking out for...

I was wondering if there is a way to make sure that orders had a postage portion to them before people would pay, thus ensuring postage costs were catered for.

Is there also a way of putting a Bio on the front page of coppermine

keep up the good work... great piece of code

regards

martin
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 27, 2004, 05:21:22 pm
Hi Martin,

I was wondering if there is a way to make sure that orders had a postage portion to them before people would pay, thus ensuring postage costs were catered for.

This is done in your Paypal account.  You log on, and go to your account, then set the postage costs in your profile.  You can also set up your basket page to look like it is part of your site here, along with any re-direct pages once your users checkout.


Is there also a way of putting a Bio on the front page of coppermine

You can use the anycontent.php for this. 
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: big nose on July 27, 2004, 09:54:49 pm
Hi Casper

Ive tried running the update script on the latest 1.3.1 version I get the following error

SQL-query : 

ALTER TABLE `CPG_filetypes` DROP INDEX `EXTENSION` ,
ADD PRIMARY KEY ( `extension` )

MySQL said:


#1091 - Can't DROP 'EXTENSION'. Check that column/key exists

any ideas

regards

martin
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 27, 2004, 10:25:19 pm
Hi Martin,

that is part of the normal update, not for the shop, and should not cause a problem.

However, if you have already updated to 1.3.1, and only want to add the shop fields, use the attached file, which you will need to use to replace your existing update.sql., and then run update again.

Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: big nose on July 27, 2004, 10:45:19 pm
Thanks for the reply

Ok Ive run the update and now Ive got another problem as whenever I try and use the save config button at the bottem of the config page it opens up the paypal shopping cart...

this only seems to happen after running the update

This the error after running the update

SQL-query : 

INSERT INTO CPG_config
VALUES (

'size1', '0'
)

MySQL said:


#1146 - Table 'photodb.CPG_config' doesn't exist

I havent generated any albums or other content before running the update

hope this helps

regards

martin
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 27, 2004, 11:17:20 pm
Did you do a full install of version 1.3.1 before doing the mod, and checkit was working?

When working correctly, and with all files installed, you update should create this query;
Quote
INSERT INTO yourprefix_config
VALUES (

Not this;
Quote
INSERT INTO CPG_config
VALUES (

Unless of course, your prefix is actually 'CPG'
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 28, 2004, 12:06:37 am
There seems to be an issue, when you create a new install, then update to this mod, before you have set the gallery up, and created at least one album.

I can replicate Martins problem with the config directing to the paypal basket, instead of updating the db etc, but only on a brand new install, with no cats/albums created.

At the moment, I am unable to find the cause of this, so suggest creating a category and album, and uploading at least 1 pic, before applying the mod.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: big nose on July 28, 2004, 09:42:16 am
Thanks for that Casper was thinking I was going slowly mad....

I was getting to this thinking through testing on a standalone install on my laptop

I will now setup the mod as per your latest instructions, thanks again

Update...... just done that without loading an image and the issue with the buttons is still there, Would this be a problem with the new theme.php picking up the wrong button ID... accuse my ignorance

regards

martin
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 28, 2004, 11:15:28 am
Well, this had me scratching my head so much, I got splinters.

But I found it.  It's in the theme.php of the reynolds theme.  When I cut and pasted the button form, I cocked up.

In your reynolds/theme.php, find;

Code: [Select]
</form>
</ul>
<!--  view basket button  -->
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value='{$CONFIG['gallery_admin_email']}'>
<input type="image" src="https://www.paypal.com/en_GB/i/btn/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1">

And move the '</form>' to it's correct place at the bottom of the button.

@ Martin, Please confirm this cures the problem for you.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: big nose on July 28, 2004, 11:38:33 am
Hi Casper

well caught,,, moving the form tag has sorted this out

However I now get this error for the rating graphics at the bottem of the page

Warning: Invalid argument supplied for foreach() in /usr/local/home/httpd/vhtdocs/selectred/martin/themes/reynolds/theme.php on line 1512

All the graphics are in the folder

regards

martin
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on July 28, 2004, 12:03:45 pm
Yes, that is a known problem, which is caused by the modified displayimage.php.  It only appears if there is no image description.

If you put the original displayimage.php file back in, the shop will still work fine, and this will not happen.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: big nose on July 28, 2004, 01:01:10 pm
Kool thanks Casper....

All I need to do now is integrate this all into mambo ;-)

should be fun

once agin thanks for the help

regards

martin
Title: Warning: Invalid argument supplied for foreach()
Post by: catch22 on August 09, 2004, 05:59:35 pm
Warning: Invalid argument supplied for foreach() in /home/pos/www/www/poscpg/themes/classic/theme.php on line 1579

I have installed 1.3.1 and it works fine as a standalone.

Once I add the shop update, I get the message above. I have looked at every post dealing with that known issue, and it seems it was solved for the out of box version above. But returns after shop setup. The "old" solutions do not much apply, as the code has been changed already in this version to reflect.

I have tried 1.3.1, 1.3.0 versions. The select print sizes are not showing up either. The had shown up on an earlier install (on install 215 already  ;))

The instructions say to install version 1.3.2 before shop upgrade, but it isn't here yet...? I am looking to pay to port the PayPal function to AuthorizeNet and have some people standing by to do just that.

Any help here would be appreciated.
Title: Re: Warning: Invalid argument supplied for foreach()
Post by: catch22 on August 09, 2004, 06:12:05 pm
Found some things on a search of "PayPal"....will try those.
Title: Re: Warning: Invalid argument supplied for foreach()
Post by: Joachim Müller on August 09, 2004, 06:37:27 pm
apparently your posting refers to a mod. It would have helped if you posted a reply to the mod you are refering to instead of starting a new thread, or at least post a link to it.

GauGau
Title: Re: Warning: Invalid argument supplied for foreach()
Post by: catch22 on August 09, 2004, 06:49:45 pm
Problem of the Invalid Argument solved in

http://forum.coppermine-gallery.net/index.php?topic=7619.msg37025#msg37025

Simply replacing the original install versions' displayimage.php over the shop version.

Problem of print size selection not showing up is due to no image descriptions. This is solved more premanently in that topic above, I just don't have the stamina to follow through today.

Title: Re: Warning: Invalid argument supplied for foreach()
Post by: Casper on August 09, 2004, 09:38:46 pm
If you use the latest version of the mod, there is no need to have descriptions for the prices etc to show.

Merging with the correct thread/board
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: catch22 on August 11, 2004, 08:27:51 am
Hello. I installed a clean version of 1.3.1, downloaded 8/10 from sourceforge. I then ran the shop-update routine, also just downloaded, and overwrote displayimage.php, avoiding the PHP error.

I still, however, must have a description to have the cart sizes/prices show.

http://scientificsound.com/copper

This is not a show stopper, but curious.

Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on August 11, 2004, 12:20:31 pm
Can you please post screenshots of this, as I am unable to replicate.
The prices will not show if the pic has no title, but should not need a description, as shown on my screenshots attached.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: catch22 on August 12, 2004, 10:51:43 am
Screenshots of example of pic needing title before cart shows:

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fscientificsound.com%2F01.gif&hash=27063021d8c798fea5e03180b3437ec9d7f1307f)

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fscientificsound.com%2F02.gif&hash=c258e1d3a04a88e8013b336172dc91cce901d5e8)

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fscientificsound.com%2F03.gif&hash=aa3edd3171697b89f451bb3ca932261a28bbb5de)
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on August 12, 2004, 11:28:05 am
Yes, I accepted and agreed it needed a title.  The selection boxes will not show.  But even if they did, the paypal form would have no info on what was being ordered, as it uses the title.

But you originally said it would not work without a description, not title.  This was a problem with the first version of the hack, but should not be happening now.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: JakobG on August 12, 2004, 05:23:13 pm
Is it possible to do this for more than one account on one site? So say you have two users that both have paypal accounts and are using the same website to show their photos?
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on August 12, 2004, 05:28:44 pm
Yes, you can have as many installs of coppermine (and that includes ones with this hack) on one website.  You can even have them all use the same database.

What you need to do, is create each install within its own directory, then during install, specify a unique table prefix for each install.  I suggest changing the cookie names as well.

Then each install is totally seperate.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: JakobG on August 12, 2004, 05:37:50 pm
Fantastic, thanks for that!

I've just noticed that I cant batch add any files... the page comes up and shows select the directory and thats it... no actual selection possible! Any ideas?
Should i have created an album and batch added before adding the shop mod?
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on August 12, 2004, 05:42:03 pm
This is probably because you added them to the 'userpics' directory.  They must not be in there, but in new folders you create in the albums directory.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: JakobG on August 12, 2004, 05:58:01 pm
Yep... you got me! Thanks for all the help casper!
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Detonate on August 19, 2004, 07:07:15 pm
This is an excellent hack!

And to think I was very close to dropping $399 on LightBox Photo Gallery (http://www.lightboxphoto.com/)!

There are a couple of things I was thinking about changing, and was wondering if anyone was interested in helping.

One thing I thought that might be useful would be setting the Prices/Options in the Properties of an Album Menu instead of the Global config.

Also, thinking that passing the filename of the image along with the Title would be very helpful.  If I have 100 pictures name "Red Flower" for example, it would be nice to know exactly which one I need to have printed and ship to the customer!

Has anyone else already worked up something similar before I start code diving?

I've never used Coppermine before, so it'll probably take me a long time to familize myself with the code.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Detonate on August 19, 2004, 09:00:57 pm
Well I got the item name stuff to work.

I'm far from a coder, so use with caution.

In displayimage.php I ADDED:
Code: [Select]
       '{FILENAME}' => $CURRENT_PIC_DATA['filename'],AFTER
Code: [Select]
       '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
in every theme.php I REPLACED ALL:
Code: [Select]
name="item_name" value="{TITLE}, size '{$CONFIG['sizeWITH
Code: [Select]
name="item_name" value="{TITLE}, Filename: {FILENAME}, Size: '{$CONFIG['size
So now my Item name looks like Rhino, Filename: zoo_01.jpg, Size: '12x14'

I suppose I could have included the path, but the filename will always be unique for me.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Detonate on August 19, 2004, 10:03:22 pm
Ok, well I did a bit more research and found some info on PayPal Carts and changed some more stuff that may be of interest to others....

Basically I replaced the line having to do with the Item Name with the following lines...
Code: [Select]
<input type="hidden" name="item_name" value="Photograph Name: {TITLE}">
<input type="hidden" name="item_number" value="{FILENAME}">
<input type="hidden" name="on1" value="Print Size">
<input type="hidden" name="os1" value="{$CONFIG['size1']}">

Now I get the Photo's Title, Image Name, Print Size, and Print Paper all in visually seperate areas.  I think this makes for the least confusing display for the average customer checking out.

Here is what the Cart Looks like...
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.redreefscuba.com%2Fforum%2Fcart.jpg&hash=8081d452a3a1e403e942ff0330c0a7c52670593b)
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: adriano on August 22, 2004, 01:35:47 pm
Hello Capsar,
I just read about this wonderful mod and I think, I can use this on a new site I plan. This will give coppermine a big step foward to a shopping site. As I could see, all I can sell is only prints from my photographs. Is there a way to use the paypal account for downloading some pictures after the customer paid?
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on August 22, 2004, 09:44:24 pm
@Detonate, I think the changes you have done are a great improvement, and will incorporate them in the downloads soon.  ;)

The setting the prices by album would need a complete rework, but if anyone can do it, would make having differnt prices much easier than the present method.

@adriano, this could probably be done, associating the zip downloads with the payment, but would also require a lot of changes.  It will probably be easier in version 1.4, which will have server side favourites, nstead of the current, client side favourites.
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Casper on August 24, 2004, 12:10:03 am
I have updated the hack to include Detonates changes.  The files are all available to download from my shop demo.
They are not yet available from the downloads section on this site.

@ Gaugau, will email files to you.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: wprowe on August 27, 2004, 07:44:29 pm
Hi. I am a professional photographer and am interested in incorporating your PayPal hacks into my coppermine gallery. I applied the shop-update and the theme I like (igames). I noticed that each image size I configured shows up as a separate line. Could it be made into a drop-down menu selection (pick-list) so it doesn't take up so much real estate? It might take a little coding to determine the menu selection chosen before making the cgi-bin call to paypal to update the shopping cart. Is this possible? I saw one demo that shows something like this for paper types. That type of selection for print sizes would be great. Also, I have about 10 print sizes I offer. How hard would it be to expand it from 6 to 10 possible sizes?

Thanks much!
Title: Re: Hack[1.3x] add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on August 29, 2004, 01:05:40 pm
@ Gaugau, will email files to you.
Got the email, sorry for the delay.

[off topic]
The medium "email" get's increasingly unusable for me, with the amount of spam and virus-infected mails sky-rocketing to over 800 unwanted emails a day. I'm still experimenting on spam filtering systems, but I either get a lot of false positives, or the filter is unusable completely for me because most spam passses through it.
[/off topic]

I changed the package names on the server, here are the new download links:
shop hack with all themes: http://prdownloads.sourceforge.net/coppermine/cpg1.3.x_mod_shop_all_themes.zip?download
shop hack with classic theme only (recommeded for usage with custom theme): http://prdownloads.sourceforge.net/coppermine/cpg1.3.x_mod_shop_classic.zip?download

@Casper: have you made up your mind yet to add the paypal hack to the coppermine core (admin settable of course) for cpg1.4.0? Maybe we need to discuss this on the dev board, as I must confess I haven't looked into the hack too deeply, so I'm not sure on the impact of adding the mod to the core would have.

Joachim
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on August 30, 2004, 11:44:20 pm
sorry for the delay in answering, I'm just back from 5 days motorcyle rally on the continent, and just catching up. 

@wprowe,

In answer to your question, if you do not offer choice of paper type, just sizes, then this would be easy to modify.  If you want to offer both, that would not have worked with my original hack, but I have done several changes, and it may be possible.  I will look into it tomorrow.


@GauGau,

I doubt it would fit well in the core code, and would be best as an add on, but as you suggested, I will bring it up on the dev board.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: jayos on August 31, 2004, 10:51:30 am
This mod is just what I have wanted to do great work Casper ;)

I want to tweek a couple of things, I would like to have standard coppermine albums so friends and family can upload pics leave comments etc.
also the functionality of this mod so I can sell pictures in certain galleries

Why do we have to lose voting and comments is it possible to keep these functions?

I want to add a number of size options for my photos with different prices for each option how could I do this so it works in the same way as the link below
   
http://about.reuters.com/pictures/prints/galleries/preview.aspx?gallery=This%20Week&story=631934490331836250&picture=X002550020040822e08m0002t.jpg
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on August 31, 2004, 11:35:31 am
Why do we have to lose voting and comments is it possible to keep these functions?

The latest version available from the downloads section, or my demo, does not lose these functions.


I want to add a number of size options for my photos with different prices for each option how could I do this so it works in the same way as the link below
   
http://about.reuters.com/pictures/prints/galleries/preview.aspx?gallery=This%20Week&story=631934490331836250&picture=X002550020040822e08m0002t.jpg

It is easy to add extra size/price fields, but getting them in a dropdown box, on one paypal line, I would have to look into.  You are not the first to ask for this, and I agree it would be good if all choices could be done this way.  But I have a lot to learn when it comes to paypal baskets etc.

I am looking into this.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: jayos on August 31, 2004, 04:54:43 pm
Thanks Casper

I want to use the smf theme is the code I will need to change the same as described in complexshop.txt ?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on August 31, 2004, 05:11:58 pm
Hi Jayos,

what are you wanting to do.  Do you want to have different prices available in different albums/categories.  The hack for the standard shop has changed a lot since then, but I can take you through it if you tell me what you want.

Although the smf theme is not included in the downloads, it is easy to add any 1.3 theme to the standard hack.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: jayos on August 31, 2004, 07:12:04 pm
Hi Casper

I want some albums with photos for sale and some just showing photos, pricing will be different for different albums and categories and using the smf theme

I have managed to get the hack working but when I view basket it takes me to your paypal checkout ???? and I did remember to change the email address in theme.php

link
http://www.jaypix.co.uk/gallery/displayimage.php?album=9&pos=0

username     test
pass     test
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on August 31, 2004, 07:53:51 pm
First, this should show your own paypal account if all the steps have been followed.

But I am going to update this hack tomorrow, if you can wait.  It will then use the same method as the current simple hack, but with instructions how to set up the albums/cats with different or no prices etc.

I will help you get this set up easily.

Please PM me with how many different size/frame options you want to give in total, and how many setup variations you need.  I will then work it out for you.

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Detonate on September 01, 2004, 03:06:09 am
The way I've been doing it, is files with Titles are available for purchase, while files without titles are not.

Example Gallery with Titles:
http://www.redreefusa.com/thumbnails.php?album=5

Then I made a [ paypal ] type UBB code to insert Buy now buttons in Gallery descriptions so that my users can buy entire albums on CD.  Example:
http://www.redreefusa.com/index.php?cat=6

The actual album description looks like this:
Code: [Select]
[paypal]Open Water Date 2004.07.04[/paypal]CD includes all pictures in this album in full resolution, and any additional photos taken that are not displayed. and the bb_decode function does the string replaces.


I haven't quite figured out a good way to change prices on individual items, or for different catagories yet.  But that need hasn't come up for me yet.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: wprowe on September 01, 2004, 07:56:54 pm
Currently, the update script has a fixed maximum number of sizes and prices that is creates entries for in the config database (which of course can be changed manually). It would be nice if all of this size information were dynamically configurable from the config screen. For example, the config screen could ask whether you want to support a PayPal shopping cart, and if so what is the PayPal account name (e-mail address) and how many sizes you want to make available. I would like the gallery admin e-mail address to be a different variable than the paypal account e-mail address.

Upon saving the configuration, the revised config screen would now show the additional fields for paypal account name and each of the size descriptions and their prices. The configuration save process should also make any necessary revisions to the config table in the database to insure enough variables are defined for the number of sizes the administrator indicated. Assuming all of the size description and price variable names have a distinct, matchable pattern (i.e. "shopsize_"), you could make your parsing of the config table find them and create the proper associated array indexes in global config associative array and then populate their values. The revised theme.php could scan the indexes of the associative config array looking for these indexes and dynamically create the drop down menus for the appropriate number of sizes.

I realize this is much more enhanced than is there today, and that your code is free and done on your own time. These are just enhancement suggestions that would make managing the whole setup of the shopping cart feature easier. I don't know too well how all of the coppermine pieces fit together, so my implementation details are based on limited familiarity with how coppermine works.

This is a great enhancement for my photography business and I very much appreciate your work on this feature.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 01, 2004, 11:21:24 pm
This hack is easily changed to suit most peoples wishes, but there are just too many variables, and I am not a good enough coder, to make this fit all requests without some work by the end user.

Changing the paypal email to be a different one from the gallery admin email makes sense, and is easy enough, so I will add this in the near future.

Adding more fields to the database is an easy enough task, and most users will find the 6 fields enough.  This makes the work required to make this all done in config not worth the effort, IMHO.

There has been some small talk about making this a core part of the code, but as paypal is just one of several payment methods, and most users do not want this for their install, I do not believe this would be for the good of coppermine.  And if it does go in, it will need a better coder than me.  I believe that having it as an easy add on, is the best way to go.

That is not to say there can be many more improvements.

I have today been working on having the size selection as a dropdown box as well, and have got it to work.  You will then just have one line under the pic for selection of all options, including size.  There are some drawbacks to this though.  The current method makes the basket clear and easy to understand.  But this change uses javascript to achieve the result, and the basket is a little more messy, although still works.  You can see this on my demo (http://www.hsocuk.com/shop/index.php)  by selecting the classic theme.  See the difference by adding something to he basket in this theme, then change themes to one of the others (except reynolds 2 or 3), and adding the same pic again.

I believe the set up of the basic shopping basket hack is now very easy to implement, and I am rewriting the complex one to use the download as well, making that much easier.  Also the javascript selection mentioned above, will make it easier easier to do the complex shop, with different categories selling at different options or prices.
I am also writing instructions for how to add this to other themes.  But as you mentioned, I do this in my spare time, and the last few weeks there has not been much of that  ;D
Title: Re: add a Paypal shopping basket to your gallery.
Post by: wprowe on September 03, 2004, 04:13:13 pm
Casper - the dropdown menu on the demo looks great and is exactly what I was thinking. Thanks for that! Great work!

While I agree that coppermine should not have a paypal specific shopping cart system, it would be great to have a generic shopping cart feature. My vision for it would be to work similar to themes. In themes, each theme is required to define the same specific variables and functions. A shopping cart system could work very much the same way. Then the appropriate places within the core of coppermine or the themes code would call these functions or reference these variables.

Also like themes, a cart system could place files under different subdirectories of a common "cart" directory. Within each payment system's subdirectory, the file(s) would have the same name (i.e. cart.php). For example, there might be


Each of these cart.php files would define the same variables and functions - perhaps "cart_add", "cart_view" and "cart_checkout". They might also have to define some javascript like you write for paypal to properly handle the dropdown menu selections for sizes and paper types. I would want to think about this more to determine if that was necessary.

An option in the config menu would determine whether the cart feature is enabled or disabled, and a drop-down selection in the config menu would define which payment system's implementation is called. By working in a similar manner to themes, it would be easy for people to add support for many payment systems, all of which would be pulled into future releases of coppermine. It makes it an extensible cart system.

All this is just thinking out loud ... what do you think? I might be willing to contribute to this effort.

Thanks again for the hack you have provided. Its great and much appreciated!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 03, 2004, 05:44:15 pm
An option in the config menu would determine whether the cart feature is enabled or disabled, and a drop-down selection in the config menu would define which payment system's implementation is called. By working in a similar manner to themes, it would be easy for people to add support for many payment systems, all of which would be pulled into future releases of coppermine. It makes it an extensible cart system.

Version 1.4 is coming with a plug-in manager, activated in config, and your idea would fit well with that, making each cart system a plug-in.  Sounds interesting, doesn't it.

I am really struggling for time this next few days, but will be spending a few days getting this back up to speed from Monday, when I will put up the files for the dropdown menu.  Paypal normally has a maximum of 10 options on any 1 list, so I will work to allow users to have 10 size/price options.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: wprowe on September 03, 2004, 06:21:34 pm
Thanks for the prompt reply. I just realized that the system might also need a "cart_config" that would work inside the confines of the coppermine config menu and would have fields specific to that particular payment system (like e-mail address for paypal). The 1.4 release plug-in manager sounds great.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: wprowe on September 08, 2004, 08:25:22 pm
Casper,

Here is an article I found on integrating PayPal via PHP. Don't know if this is helpful, but it might be.

http://www.devarticles.com/c/a/PHP/Quick_ECommerce_with_PHP_and_PayPal

Title: Re: add a Paypal shopping basket to your gallery.
Post by: big nose on September 10, 2004, 05:06:38 pm
Hi Casper

Ive got your mod running on my freelance web site, being able to take orders on wedding photos is great. This would allow me to show off some of my special pics that I dont really want to sell or cant sell as they are from commisions.

what would be great is if I could exclude a gallery from the shop... is this possible

or could I run two gallerys within one site.... sounds messy

any ideas

regards

martin
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 10, 2004, 07:09:52 pm
Hi big nose,

yes, just do the following,

make a copy of your shop theme, but with the original unedited theme.php.  It is best if this has the original name, i.e 'hardwired', and the shop theme is also obvious, say 'hardwiredshop'.

Now create the albums you want to display without the shop additions, and make a note of the alum ID numbers.

Open your include/init.inc.php file, and find the following code;

Code: [Select]
if (!file_exists("themes/{$CONFIG['theme']}/theme.php")) $CONFIG['theme'] = 'classic';
require "themes/{$CONFIG['theme']}/theme.php";
$THEME_DIR = "themes/{$CONFIG['theme']}/";

Now change the above code to this (amending as required);

Code: [Select]
if ($_GET["album"] == '4'  || $_GET["album"] == '9') {
  $theme='hardwired';
       require "themes/hardwired/theme.php";
       $THEME_DIR = "themes/hardwired/";
} else {

if (!file_exists("themes/{$CONFIG['theme']}/theme.php")) $CONFIG['theme'] = 'classic';
require "themes/{$CONFIG['theme']}/theme.php";
$THEME_DIR = "themes/{$CONFIG['theme']}/";
 }

In this example, albums 4 and 9 will display in the original hardwired theme, all others in the gallery default.  You can have as many albums you want in ths query.

Now just go into config, and set the gallery default theme to 'hardwiredshop'.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 12, 2004, 03:57:08 pm
I have completely updated this mod, to add a dropdown selection for the price size options, which allows up to 20 such options to be set.  

The files are available from the demo (http://www.hsocuk.com/shop/index.php), and I have kept the old mod files available there as well, for those who prefer the look of that.

The instructions for allowing different albums to show different price options, are also attached here, and on the first post of this thread.

I have emailed these new files to gaugau, but it may be a few days before they are available from the downloads section here.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Jonj1611 on September 14, 2004, 12:16:50 am
Hi, I have installed the shop mod and it all seems to be working, do you know if there is a facility so I can charge say £0.99 per photo download and then it takes the customer to a page for download? I need it so they can obviouslly only download the picture they have paid for, anyone know a way of doing this, thanks!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Jonj1611 on September 14, 2004, 12:35:56 am
Hi, well I thought I installed it correctly, obviouslly not, nothing is showing in config. I know it says do an update, but how do you do that? I can't see anywhere to do an update, please help. Thanks.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 14, 2004, 12:40:05 am
To run an update, simply browse to www.yoursiteaddress.com/yourgalleryfolder/update.php

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Jonj1611 on September 14, 2004, 01:14:45 am
Hi Casper, thanks for the reply, I ran the update and it said it had been upgraded but nothing has changed? I couldn't find any documentation with the 'classic download' so I don't even know if I have done it correctly, I uploaded the three files from the classic folder into the themes/classic folder, was that the correct place to put them? Thanks for any help.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Richy.nl on September 14, 2004, 02:27:46 am
Hey Folks!

I've done everything to start also a paypall shop with this great hack!

But I can't see the buttons to order the diffent sizes / glossy / etc.

How about to develop the hack in a 'online download shop'?

My website to check my store: www.richy.nl/shop/

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 14, 2004, 12:20:26 pm
Hi richy,

it looks to me as though you have not added the image description, as is required for this hack to work. 
If you want to send me an admin account login, by pm, I will look into it for you.

Off topic.  Your thumbs look terrible, as though you created them at a small size, then changed the settings.  You would be better off with smaller thumbs, or use the admin tools to re-build the thumbs to the new size.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Jonj1611 on September 14, 2004, 04:23:42 pm
Hi Casper, Um, any chance you could help me with my problem, I guess you just missed it as I posted two seperate questions, anyway it went like this :-

Hi Casper, thanks for the reply, I ran the update and it said it had been upgraded but nothing has changed? I couldn't find any documentation with the 'classic download' so I don't even know if I have done it correctly, I uploaded the three files from the classic folder into the themes/classic folder, was that the correct place to put them? Thanks for any help.

Thanks.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 14, 2004, 04:29:12 pm
Please pm me an admin login to your gallery.

Did you replace all the other files required for the mod, the english lang file, the sql files in the sql folder, the upload, editpics, editonepic and displayimage files.
Did you follow all the instructions contained in the index.html file contained in the docs folder of the hack download?

As for the question about allowing download after payment, I don't know how to do that.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Jonj1611 on September 14, 2004, 04:37:49 pm
Hi Casper,

Many thanks for your reply, I downloaded the "classic" shop zip file, it only contained three files and one directory, it doesn't even have an index.html file. Obviouslly I have got the wrong file but all the other shop mods seem to say installation is the same as the basic version, but I don't even have that. Any idea where I can get a copy of the basic shop from. Thanks
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 14, 2004, 05:06:30 pm
First, where did you get the classic shop theme from, the downloads section here I assume.

Second, have a look at the shop demo (http://www.hsocuk.com/shop/index.php), and see the latest look of the mod.

You can get the mod files there, where there is a choice of the original mod, and the newer, easier mod, look in the downloads category.

if you need help, let me know.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Jonj1611 on September 14, 2004, 05:14:21 pm
Hi Casper, yeah, I download the mod from your download section, I downloaded the theme/classic, is that the right one?  I also downloaded the other file but I couldn't find the theme.php it mentioned, the only one I could find was on my coppermine site, when I opened that it did not have the code you mentioned, sorry about this but I feel really thick here!  ???
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 14, 2004, 05:32:25 pm
I'm still not sure if you mean you got it from my demo site, or the downloads section here at sourceforgre.

You need at least one of the theme zips, but you also need the shop update mod zip, which contains the instructions and all files needed.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Jonj1611 on September 14, 2004, 06:20:03 pm
Hi Casper, I downloaded the list mod(theme/classic) from your demo shop and also from your demo shop I downloaded the Shop Update New. On the instructions there is this bit -

Within each theme folder, file called theme.php.
Open this file, and find this code;

{$CONFIG['size1']}; {$CONFIG[currency_symbol]}{$CONFIG['size1_price']} and so on and on

I can't find that bit in any theme.php file.
Hope I am making sense. :)
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 14, 2004, 07:01:05 pm
OK, it seems you have the theme files from the original mod, not the new mod.  I have attached here the classic zip file for the new mod.  Use this theme folder to replace the one you already have.  If you want to try different themes, they are all in one download from the same album you got the shop update.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on September 15, 2004, 11:13:49 am
Updated the mod files in the download section, reorganizing them a bit: there's one file that has the mod to the core files only, and one file that contains all the modified themes that are necessary to actually use the mod:
http://prdownloads.sourceforge.net/coppermine/cpg1.3.x_mod_shop_no_themes.zip?download
http://prdownloads.sourceforge.net/coppermine/cpg1.3.x_mod_shop_all_themes_only.zip?download

Joachim
Title: Re: add a Paypal shopping basket to your gallery.
Post by: elica on September 21, 2004, 10:49:51 am
there seems to be many problem with the files "cpg1.3.x_mod_shop_all_themes_only.zip donwload" temes.php code are not right it dosent display drop down paypal menu. theme hardwired for exemple, can you help me?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on September 21, 2004, 11:03:00 am
I just tried 'hardwired' on my paypal hacked site, - and it works. The Paypal thing works only on images with 'titles' on.. could that be your problem ?
On images with no title, - I get no drop lists at all... but I have a feeling it's more a feature than a fault :-)

But you obviously need to be aware of it.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on September 21, 2004, 11:06:31 am
When I change "Show first level album thumbnails in categories" in the config menu, - on any of the paypal modified themes, - I still get images shown.
On the other non-paypal Gallery I run, the button works as exspected.

I've tried 3-4 or them, - so I assume they all work like that.

Does anyone know why ?

Kim Igel
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 21, 2004, 01:00:36 pm
@  elica,
  First, did you actually also download and do the actual shop mod.  The themes do not work by themselves.
  As kiig pointed out, the dropdown box will not display if there is no image title.  If this is not the case with you, please pm me an admin login and password, along with your site address.


@  kiig,
  This does not happen on my site, the config setting for 'show first level album thumbs' works as expected, in all themes.  See the attached pics.  
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on September 21, 2004, 01:47:33 pm
strange.. I have verified that it changes the First_level key on the database correctly from the config menu.... maybe I'll start all over again by re-downloading the Paypal mod, - and remove both coppermine installation and database... this is all too weird.

I have even modified the theme_display_album_list_cat function (changed it so it does nothing), - but still I get the images shown.. changing the function name to something else, - still shows the images in the category list. Either I'm editing the wrong file in the wrong place, - or something is very strange here....

Is this still the lates Paypal files ?

http://prdownloads.sourceforge.net/coppermine/cpg1.3.x_mod_shop_no_themes.zip?download
http://prdownloads.sourceforge.net/coppermine/cpg1.3.x_mod_shop_all_themes_only.zip?download

thanx.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 21, 2004, 01:52:50 pm
Yes, they are the latest files.

But the mod does not require you to edit any code, other than to remove options you do not need from the theme.php.  All the code changes needed are in the files included.

Why are you editng other functions?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on September 21, 2004, 02:06:06 pm
I just want to add some of my own images in the header, - tweak the layout a bit, - nothing much... assuming I can do that with a theme... ??

and at some point I wanted to remove the images from the category list and I ran into trouble. My other modications also revieled that having coppermine in an Iframe could cause a problem with certain themes from the Paypal package... I have several weird things, - which all lead me into the code.... :-) (I do php programming in my sparetime)

But now I'll redo it all, - and then I'll see if all my problems persists....

I assume I should the install a regular coppermine 1.3.2 (starting with empty folder + no database), - create at least one album and upload at least 1 image (i seem to recall that)
then I apply http://prdownloads.sourceforge.net/coppermine/cpg1.3.x_mod_shop_no_themes.zip?download and the other with the themes, - and run update.php (is it?) once more...

Correct?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on September 21, 2004, 03:43:41 pm
I just reinstalled a new 1.3.2... I still can't change the "Show first level album thumbnails in categories" correctly.... as this is my second coppermine on the same machine, - I'll look somewhere else (other threads that is) for a possible solution, but for now it explains my problems listed earlier in this thread...

Kim Igel.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 21, 2004, 04:23:17 pm
You can add your own content, there are several ways to do that, and you can change the layout, but you should not be changing the functions to do what you want.

Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on September 21, 2004, 04:28:46 pm
Erm... I feel the need for sponsering beer for everyone involved.... Ahem... the "Show first level album thumbnails in categories" *does* work.... I obviously need to create *CATEGORIES* before I can have Coppermine show images or not... damn.... took a while.... glad I made a backup before trashing my site.... Thanx guys.... and sorry.. :-)

Kim Igel.

@ Casper : I have no need to change the code, - just wanted to track down what CPG is doing where and how, - because I was curious as to why I had this aledged 'problem'... it was all for 'educational' purposes.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 21, 2004, 05:25:59 pm
OK, glad you got it sorted.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on September 22, 2004, 11:52:26 pm
The Paypal ordering options only come up when there's a title on the image....... where is the code for that (if I want to use the paypal options even with no title) ?

thanx in advance

Kim Igel.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: squeeze on September 23, 2004, 12:29:53 am
can anyone tell me what folder i upload _mod_shop_no_themes to on my server thanks lar
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 23, 2004, 12:42:44 am
You don't.

You download it to your pc, then unzip it.
Now look in the docs folder, find and open the shop.html.
All the instructions are in there.

You will also need to download the themes zip, http://prdownloads.sourceforge.net/coppermine/cpg1.3.x_mod_shop_all_themes_only.zip?download
and choose the theme you want.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: squeeze on September 23, 2004, 01:28:34 am
okay have it set up but wont let me save my optios for size and price hit the save button in confic when done check back and there gone any ideas thaks lar
Title: Re: add a Paypal shopping basket to your gallery.
Post by: squeeze on September 23, 2004, 01:30:44 am
also have the buy button the gallery page sometimes.............
Title: Re: add a Paypal shopping basket to your gallery.
Post by: squeeze on September 23, 2004, 01:42:04 am
hmmm but if you hit buy a size comes up but no title but theres no sizes listed in the drop down menu. lar
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 23, 2004, 01:48:44 am
Did you run the update?

Please give a link to your site.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: squeeze on September 23, 2004, 03:59:33 am
yes i did the update http://lvmphoto.com/gallery/coppermine/index.php?cat=10001 just wont save any of the size and price values in the config...........
Title: Re: add a Paypal shopping basket to your gallery.
Post by: squeeze on September 23, 2004, 04:15:09 am
ok reuploaded and ran the updates seems allright now thanks for your help larry.................
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on September 23, 2004, 08:00:44 am
you don't just upload the zip - just unzip it and read the instructions carefully.

Joachim
Title: Re: add a Paypal shopping basket to your gallery.
Post by: squeeze on September 24, 2004, 01:38:52 am
yes i did unzip on my hard drive and upload files seems to be working good just have one bug when on the main gallery page if you hit the @ for login the basket button appears in the middle of the buttons with the login and the login is moved to the middle of the screen........http://lvmphoto.com/gallery/coppermine/index.php?cat=10001
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 24, 2004, 12:40:36 pm
Hi squeeze,

try the attached 2 files.  I have altered the project theme to show the basket in the top right all the time, and the log-in etc is now left justified.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: JJ Photo on September 27, 2004, 02:21:14 am
Would you please consider offering detailed installation instructions for those of us with already modified files (outide of the theme folders which I can handle)?  Step by step, copy and paste instructions would be wonderful and greatly appreciated.

Thank you!
JJ Photo
Title: Re: add a Paypal shopping basket to your gallery.
Post by: JJ Photo on September 27, 2004, 04:33:01 am
Does this mod break or remove the photo comments that the default install displays?  I notice in the documentation:

Quote
Now find the 'Custom fields for image description' section, and in field 1, insert 'Description'.

I would like to use the default description field and not a custom one please.  Also even when I did use the description field as noted above this would not display under the photo.  Is this correct or a mistake on my part?  I've installed this mod twice now and get the same result, no description under the photo for the medium size display (I don't use the full photo zoom window zoom thing).  The thumbnail gallery still displays the default description field.  Why duplicate the description field when it's already there?  How can I re-enable the default description field under the photo title?

edit: I notice that when I edit a photo, the default description field is gone!  This is very unfortunate and I don't see why the mod would even want to do that.  Please advice on how to restore the default description field.

Please advise,
JJ Photo
Title: Re: add a Paypal shopping basket to your gallery.
Post by: JJ Photo on September 27, 2004, 05:48:25 am
Okay I've fixed the default description (caption) field not showing when this mod is installed.  You need to replace the file 'editOnePic.php' with the default file and then paste this into your theme.php where you want the description to display:

Quote
<!-- BEGIN caption -->
                                <tr>
                                        <td>
                                                {CAPTION}
                                        </td>
                                </tr>
<!-- END caption -->

I've pasted that just under the {title} declaration and above the shopping cart system.

As far as I can see, there is no need to use the editOnePic.php included in this mod but I could very well be mistaken.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: OmegaGOD on September 27, 2004, 09:37:22 am
CASPER!!! THANKS a billion and a half for this mod!   :D ;D I followed the directions and it worked perfectly! No glitches and no heart ache... My recommendations to people who are looking to install this mod. READ THE DIRECTIONS in the DOCS folder. If you read them and do it step by step, you won't have ANY problems.

Question: All of my prices do not include tax / shipping charges. Now as much as I don't like to tax people, it surely is a problem come end of the year :-( Is there a modification to add sales tax and say a flat rate for shipping? I did search paypal and it looks like there are two things offered. A standard shopping cart which you implemented so well and a "buy now" shopping cart which is the same as the standard shopping cart, except for the fact it that upon checkout, it will automatically figure taxes and add shipping charges which you specify in advance. I will provide the link to the "buy now" shopping cart on paypal, but you will need to login before being able to view it.

https://www.paypal.com/us/cgi-bin/webscr?cmd=p/xcl/rec/singleitem-intro

I will see if I can implement the "Buy now" shopping cart with your codebase. Let's see how well i muck it up :-)

-- OmegaGOD
"Oh My God"
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 27, 2004, 11:20:55 am
@ JJ Photo,

are you using the latest mod, with the dropdown box for size selection on just one line, or the earlier one with a add to cart button for each size.  The editonepic.php has to offer the same boxes to edit as the upload.php and editpics.php.

I will post code changes for each file, so those with already modded files can apply the mod.  BUT, other changes may well affect the operation of the hack.

The current mod, with the dropdown box, allows full display of the comments etc.


@ OmegaGOD,

I see no problem with changing the add to cart button with a buy now button, but it just means it will put off people who want to buy multiple pics, that they have to go through the buying procedures many times, instead of just once.  In fact, my first attempts at this mod did just that.

As for taxes etc, as you said, there is the facility in your paypal profile to set tax and shipping costs, which are added at the and of the sale. You can set both there to be what you need, for instance, postage costs based on quantity, or total costs etc.  Also, as each user in each different country will have to set different tax levels, this is the best place to set the tax.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: JJ Photo on September 27, 2004, 03:35:58 pm
Casper thank you very much for your reponse.  Yes I'm using the latest version with the dropdown box.  What boxes to edit does editpics.php (and also editonepic and upload) offer? I don't see anything extra on my install.  Hmm.  I see in your example pic on page 1 of this topic there is a 'price' field (is that all?).  I don't see that field on either of my installs on editonepic or editpics or upload either.  I don't see any extra fields at all.  Sobs..  I'm using coppermine 1.3.2 on Apache.  Please advise.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 27, 2004, 04:16:26 pm
Hi JJ,

all the pics on page 1 of this thread are out of date, except the pic on the very first thread.

The original description field was needed to get the price, which is why it was changed, and one of the optional fields used instead.  As the price is now gathered from the database, I think we can probably go back to using the original field, but it will require changes to upload.php, editpics.php and editonepic.php.

Let me look into this.  I will get back to you on this soon, but bear with me, I'm having puter problems, with my home network playing up, and difficulty getting on the net.

More problems in the 2 weeks since I upgraded to SP2, than in the previous year.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: OmegaGOD on September 28, 2004, 01:04:02 am
@ Casper

Thanks. Yep it looks like the standard shopping cart allows you to calculate sales tax and add shipping. I had to set it up in paypal. I should have looked first before posting the question. Thanks Agian

--OmegaGOD
Title: Re: add a Paypal shopping basket to your gallery.
Post by: JJ Photo on September 28, 2004, 02:26:30 am
Thank you Casper.  This is indeed what I need and I eagerly await hearing from you.  Re: your difficulties with SP2.  I understand.  There must be a way to disable that firewall (I use Tiny Personal firewall which is quirky but works quite well) to use a better one.  I haven't looked into that yet.

Will your changes to the files mentioned be find/replace of the code or complete file overwrites?  I would prefer the former please, since tonight I need to reinstall my entire coppermine install due to a bridge attempt failing disastrously (arg!).  I will install your mod then another one (sorting of photos in album) so I won't be able to replace your files without loosing my changes for album sorting.  (upload.php and enlish.php I know are two that the sort mod changes).

Cheers for your work!
JJ Photo
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on September 29, 2004, 09:43:11 pm
OK, sorry it took so long, but I've had a few days of puter probs.

Anyway, I looked at the complete mod, to see which of the bits where left over from the earlier mods, but now redundant.  There were several, including there being no need to change the upload.php, editpics.php and editonepic.php

Attached is a zip with full instructions to add the code to existing files.

I will update the download as soon as possible.

EDIT, the attached instructions have an error.  It tells you to change the include/update.php, which should read the include/update.sql.
I will update the zip later.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on October 01, 2004, 10:41:31 pm
I have updated all the files, with the simplified mod, and they are available from the DEMO (http://www.picture-parade.co.uk/shop/index.php).

The download contains everything needed to start up, and other themes are available.  It also contains full instructions, including how to add to an already modified gallery.

The files in the downloads section of this site are not yet up-to-date, but will be soon. 
@Gaugau, I have emailed them to your site.

This is most definately the last version of this hack, although I will update it for future versions.

EDIT;
I accidentally re-introduced the 'no description = no shop buttons' with these theme files.  If you have downloaded in the last 2 days, please replace the theme with a new copy from the demo.

@ Gaugau, the themes I sent you have a bug, so please ditch them and replace them with the ones I am sending again.  Please also replace the classic theme.php in the main mod zip.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on October 04, 2004, 08:58:20 am
Updated the files in the sf.net download section with the ones Casper sent me by email (replacing the buggy version with the newer one as suggested): http://sourceforge.net/project/showfiles.php?group_id=89658&package_id=98542&release_id=256954

Joachim
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Roshlin on October 12, 2004, 08:47:47 pm
Hi Casper, :)

I really feel siily asking for support for this mod which is working fine for so many. ???

 :o Belive me I have the view basket link (and it takes you to my account) but not the sizes selector nor the add to basket.
I have set all the sizes in the config.

I have done everything that is said in the instruccions even read file code-changes in your previous post.
I have a fresh install of coppermine 1.32 and have installed your pack, so all the changes suggested in the instructions are already there I manually checked for the they are all there. I had installed this script on sunday 10th and again downloaded tooday and installed it again before asking for support.  ???

Where am I going wrong. click here to see the sitehttp://www.fotorima.com/galeria/displayimage.php?album=random&cat=0&pos=-6

I have a few sugestions also.
1. Is it possible to add the full album to the cart.
2. Adding all photos on the thumbnail page to the cart (maybe with checkboxes and a select all choice)
3. Adding photos to the cart  in the thumbnail view.

This should be cool for people who want multiple prints. Adding say 25 photos one by one on a dial up connection can be really tiring. ;D

Thanks for your help
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on October 12, 2004, 09:16:36 pm
Roshlin, - do you have a title for the images ?... The Paypal button's wont appear (unless someone modified the paypal and I didn't notice it :-)   ) if you don't have a title for the images. Try adding a title for one of them...
How have you done the 'watermark' btw... ? looks great.. :-)

Kim Igel.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: fareforce on October 14, 2004, 04:53:05 am
I have this mod up and working great. I just have one question. Would it be possable to make the price dropdown menu so when you select a value in one dropdown it will load a new set of values into another dropdown?

For example: someone selects "glossy print" it will use the dropdown with "8x10 $999.99", but if they select "Matte print" it will use the dropdown with "8x10 $555.55"?

How hard would this be?

If anyone wants to see a working demo of an active "sales" site please visit my site at http://www.alaskastudio.com New pics are always being added, so not all of them have titles yet, but will in a few days!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Roshlin on October 14, 2004, 03:04:35 pm
Hi Kim Igel,
I have added a title to the image, altavista
and it shows:  Picture; altavista , but no dropdown.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on October 14, 2004, 08:42:02 pm
Roshlin :

I went to your site, - and looked around.. :-)
First : I'm wondering why I can choose freely from ALL the templates available for Coppermine... My paypal site only offers the 5-7 templates in the Paypal file I downloaded... could be the file has been updated, - or that you somehow have merged all original templates with the paypal templates... ?


og second : If you choose the theme 2bornot2b, - THEN you'll get your paypal buttons.

I must be something with your themes...
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Roshlin on October 14, 2004, 10:53:58 pm
Hi Kiig,

Thanks for your interest.
I was only trying the cart with the classic theme which came with the cart.,as I knew that it would not work with the others till I modified them, only now I downloaded the other theme for the cart and uploaded 2bornot2b which is the first in the list.
I will try with the others.
Any idea why I get the title as "Picture; altavista" instead of  "altavista" which is the title.
Any why is there a question mark "?" in front of every price?

Thanks again for your help.
Roshlin.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on October 15, 2004, 09:13:14 am
If you look in theme.php in your selected themes folder, - you'll find :
   
Code: [Select]
                                           Picture; {TITLE}
in my Rainy_day it's line 640. Just remove the work Picture; og type something else. You need to do this for every theme you plan to use obviously.

The question marks is something I haven't seen before, - normally you control it from the admin menu, - but maybe you've entered a wrong currency or something ?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Roshlin on October 15, 2004, 04:23:51 pm
Hi,
Thanks it's the euro symbol that showed up as ? in the 2bornot2b theme, maybe some language problem.
Now its OK.
Thanks a lot
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Warped-Photography on October 30, 2004, 09:10:42 pm
Please Help!!!!

I take photographs of nightclub goers and would like to incorporate a paypal shop into my gallery www.warped-photography.co.uk/gallery (http://www.warped-photography.co.uk/gallery).

I've downloaded the hardwired theme but I get no add to basket button, and I also need to know how I link it to my paypal merchant account.

Can anyone help???
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on October 31, 2004, 10:32:58 am
Hi,
the first thing you need to do is update your gallery to version 1.3.2.  The shop hack will not work with 1.2.1.

When you have done that, you have to install the full hack, which you can get http://prdownloads.sourceforge.net/coppermine/cpg1.3.x_mod_shop_no_themes.zip?download it, and read the instructions in the docs folder, where it is all explained.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Warped-Photography on November 02, 2004, 01:35:59 pm
Thanks for that Casper, it is all loaded up, the only problem I'm having now is trying to set up the config for Paypal.  I change the details and click update, but Coppermine does not save my account details or the sizes/prices I have entered.

Any Ideas??

Dan
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on November 02, 2004, 02:23:13 pm
It seems you have not re-placed the update.sql in the sql folder with the one in the download.  Make sure you delete the one already in the folder first.

Do that, then browse to http://www.warped-photography.co.uk/gallery/update.php

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on November 02, 2004, 05:32:01 pm
Dan,

where did you get the theme files for this mod.  Your theme is showing 2 lines with the 'add to basket' button, where the latest version only has 1, and your view basket button is not in the best place.


It looks like you have an old version.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Warped-Photography on November 02, 2004, 07:25:38 pm
I did what you said with the update.sql file but it hasn't made any difference, the theme has been correctly placed now though

Dan
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on November 02, 2004, 07:33:30 pm
The update.sql in the sql folder on your server is still the one from the main coppermine download, not the shop hack.

Please use the attached file, renamed to remove the .txt, and try again.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: bloodynipples on November 24, 2004, 10:44:11 pm
Has anyone added to this hack so that it will automatically email ophoto or some other online photo processing site to produce the photo in the desired size with the desired paper in the frame and ship to the customer? 

This would relieve a lot of work on the part of the artist, allowing them to go out an shoot more photos!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: romans815 on December 07, 2004, 04:58:27 am
I have been able to install the hack, but noticed that without a title, the paypal buttons do not show up. Is thier a way around this. I have a photographer as a client and he shoots about 5000-6000 photos a week. No way would he have the time to title all those photos. He takes orders by photo number anyway, so a title is not needed. Any help would be appreciated.

Is there a way to get this function: Picture; {TITLE} to always deafult to the image name or something along those lines?

Thanks,
Tim
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on December 07, 2004, 01:11:52 pm
This will only happen if there is no title or description.

There is a tool in the admin tools to use the file name for the title.  Just use that each time after adding pics.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: romans815 on December 08, 2004, 06:01:03 am
This will only happen if there is no title or description.

There is a tool in the admin tools to use the file name for the title.  Just use that each time after adding pics.

The only thing I can find that even mentions the title is this:
Display file caption (in addition to title) below the thumbnail. There is no tool in the admin tools to use the file name for the title that I see. In the theme "Singapore" a title is not required in order for the shopping cart to display, as i said before it is too time consuming to have to add a title to every photo. Do you have any other ideas?

Thanks,
Tim
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on December 08, 2004, 10:44:56 am
You seem to be looking in the config, not the admin tools, which has a seperate link in the admin menu, see screenshots for what you need.

What theme are you using?  All themes should work the same.  Also, do you have a link?

edit, you are correct about singapore showing the paypal stuff, without the description or title.  I will look into it to see if I can see what to add to allow other themes the same.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: pengrus on December 10, 2004, 08:58:59 am
I am a newbie, so forgive me if I ask stupid question.  Looks like to me this hack is only for one user - the admin?  Will the individual registered user be able to configure and use this feature?  If not, the admin will be the only one who collects all the money?

Thank you!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on December 10, 2004, 11:18:00 am
Yes, everything ordered will go into the admins paypal account.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: pengrus on December 10, 2004, 08:38:19 pm
Yes, everything ordered will go into the admins paypal account.


If that is the case, how does the admin allocate the money between the admin and the individual community member?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on December 10, 2004, 09:17:08 pm
I havn't a clue.  Most people who use this hack use it just to sell for themselves I think.
How many members do you expect to have who would be selling?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: pengrus on December 10, 2004, 09:33:14 pm
I have several thousands of members. 

It is fine that if all the payment goes to the admin.  But if there is a way that the user can set their own price, and a mechanism that the admin/site gets x% of all the sales, that will be good.  It requires a simple account overview for each individual seller so that they will see how much was sold, and how much will be paid to them monthly. 

Do you think this is possible?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: romans815 on December 10, 2004, 09:59:59 pm
Was wondering if you had looked into what to add into allow other themes so that the paypal buttons would show up without a title?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on December 10, 2004, 10:32:01 pm
Yes, I think I got it.

Find this line;

Code: [Select]
<!-- END img_desc -->
and move it immediately above this code,;

Code: [Select]
<table> <tr><td valign="top"><form action="https://www.paypal.com/cgi-bin/webscr" method="post"
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on December 11, 2004, 08:13:43 am
it works, - showing the 'baket' buttons without a title, - but it breaks my Rainy_day theme (displayimage.php), - maybe because I need to move some of the html tags as well ?

Just to let you know, - I'll look into it myself, - but be aware of it, - if you change it.


Thanx Casper.

Kim Igel.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: kiig on December 11, 2004, 11:08:28 pm
Above the Code:
<!-- END img_desc --> I have </table>, - in RainyDay.

Moving both </table> and <!-- END img_desc --> above the 'paypal' code as Casper suggests works.

I expect the other Papal themes to behave differently, - but I guess a rule of thumb would be move the entire lump of html tags between the previous <!-- END something --> tag and the mentioned <!-- END img_desc -->

Kim Igel.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: neiljb1962 on December 22, 2004, 02:48:33 pm
Completely updated, 12/9/04

These is a mod that allow coppermine to use paypals shopping basket.

You can see a demo of this mod, and download the files HERE (http://www.hsocuk.com/shop/index.php)

The updated mod uses just 1 line with dropdown boxes for all choices (up to 20 price options), and does this using javascript.  The original mod, which used a new line for each price option, is still available for download from the demo.  It has a neater basket, but has a maximum of 6 price options.

You can also download the files from the downloads section here.

There are easy to follow instructions included in the docs folder of the downloads. All that is required to convert a standard gallery is to use the enclosed files to overwrite the standard files, then run update.

The mod included sets all albums in the gallery to display exactly the same options with every image, but if you want to have different options available in different albums, the instructions are attached to this post, as complex_shop.txt.  This does require some code changes, but all is explained.


Please note, most of this thread is about earlier versions of the shop hack.  This post, and any after and including this one (http://forum.coppermine-gallery.net/index.php?topic=8703.msg47216#msg47216), are about this current, easy to apply hack.

You may find some helpful info and tips on the other posts though.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: neiljb1962 on December 22, 2004, 03:18:46 pm
Hi Casper...

This all sounds great and Coppermine did suggest not stating if we are 'newbies'... so I won't!
I have an online photo library that specialises in selling flower photos: www.My-Flower-Images.com & www.Flower-Photos.co.uk - They raked in about $12,000 last year which isn't going to make me a millionnaire... but it was better than a kick in the teeth too!
The problem with the sites is that they are static html as I have no database experience. I need a database and that's where Coppermine comes in... except that although I've managed to modify a couple of things like making the search page my homepage (that I did as html but the search function still works)... I'm still completely lost when it comes to modifying a php file???
I need the ability to add a shopping cart to the large image window as with your PayPal... but using my own shopping cart (Mals-E.com) or using my credit card processor code for 2checkout.com - How would you feel about helping me modify a few pages and earn some commission for a period of time???
It wouldn't be a fortune... but then again, I have a lot of photographers wanting to sell their work through my sites too which is why I've set up a new website (trying too!!!) called: www.photo-image-stock.com
As well as 2,000 high res' images of flowers taken on Fuji Velvia and Sensia, I will have around 8,00 miscellanious images to add this year too BUT... I need some help... So... Might you be interested in earning some commission for a period of time that we could come to some agreement on???
I'll be watching this thread but if you need to contact me away from here: neil.bradford1@ntlworld.com
Look forward to hearing back and Merry Christmas
Neil J Bradford
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on December 23, 2004, 12:19:22 am
Hi Neil,

I'm very busy at the moment, and won't be able to do much in the next week or more.
And there's no guarantee I'll be able to help.  But I'm willing to try. 

If you send me, or attach to a post here, your add to basket and view basket codes, zipped up, I'll see what I can do.

Send me a pm if you want me to look into it, despite the delay.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on December 27, 2004, 12:59:52 pm
My demo version of the shop has moved, and is now here (http://www.picture-parade.co.uk/shop/index.php).
Title: Re: add a Paypal shopping basket to your gallery.
Post by: boyakaa on December 29, 2004, 10:48:32 pm
Hello,

           I have tried to install the older version of shop on a clean install and I cannot get the add cart button to show up? I have tried this three times ( repeating is the beginning of insanity.), then I came across this version installed it ran update and I got Nothing,

http://www.binaryconversions.com/dvd_store/

Can you assist please?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on December 29, 2004, 11:53:31 pm
Hmmm,

well the site I see still has the sort order links on the thumbnail page, whereas the mod does not.

So if you have done a mod theme as required, and described in the instructions, you need to switch to the theme you have used for the mod.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Zfolk on January 01, 2005, 09:30:53 pm
Casper thank you so much for this hack!! It is great!

I almost have it working, one problem is that when I go to the shopping cart in Paypal {FILENAME} appears in the checkout

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.folkphotography.com%2Ftemp%2Fss.jpg&hash=dc84eb31688d02657587da155d3d543b0b1ae9f5)

can someone please help?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Zfolk on January 01, 2005, 10:27:30 pm
encountered another problem  ???    hopefully you are able to answer both easily

In the doc for complexshop it says
Quote
Now, you need to create the albums for the various types of product.
You can have as many albums for each type as you want.  


You will need to make a note of each albums ID number.

How do I find the albums ID number?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: jpconijn on January 02, 2005, 08:21:56 am
Hi Casper,


Thanks you for this hack. I realy is great.

It is nearly working, but when I go to the shopping cart. I would like to see the "Album Name and "File Name". File name is allready there, is it possible to add the name of the Album instead of the Photo Name?


Thanks



Jan
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 02, 2005, 03:51:35 pm
I almost have it working, one problem is that when I go to the shopping cart in Paypal {FILENAME} appears in the checkout

Did you replace the displayimage.php with the one in the download.  If you are sure you did, what theme are you using?

How do I find the albums ID number?

Go to the album, look in the address bar.  The address will be thumbnails.php?album=-**  the ** will be the album number.


It is nearly working, but when I go to the shopping cart. I would like to see the "Album Name and "File Name". File name is allready there, is it possible to add the name of the Album instead of the Photo Name?

This will reuire changes to the displayimage.php, to get the album name, as well as changing the paypal button code.  Try looking at how displayimage gets the filename info, for hints on how to do it.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: jpconijn on January 02, 2005, 08:34:39 pm
Hi Casper,


I am a Newby, hope you can give some specific hints what I have to change to get the Albumname in the Shopping cart.

Thanks



Jan
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Zfolk on January 03, 2005, 08:03:51 am
Great!  Thanks Casper... that worked .. I guess that file did not make the transfer originally but that was the problem.  I am running the Project vii skin and it seems like everything is working great!  You can see it in action here:

http://www.folkphotography.com/coppermine/index.php

Thanks again! 
Title: Re: add a Paypal shopping basket to your gallery.
Post by: fareforce on January 10, 2005, 04:50:00 am
<<-- How to get rid of the "view cart paypal button" -->>
This mod will get rid of the gross looking paypal default button :P, and utilize the View Basket button that come with igames. I am pretty sure this will work on other templates, but I have not tested them.

Be aware of two things before you read on:
1. This was only tested in the igames theme
2. This has not been fully tested

in theme.php find
Code: [Select]
<!--  view basket button  -->

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">

<input type="hidden" name="cmd" value="_cart">

<input type="hidden" name="business" value='{$CONFIG['paypal_email']}'>

<input type="image" src="https://www.paypal.com/en_GB/i/btn/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">

<input type="hidden" name="display" value="1">

</form>
and delete it

next find
Code: [Select]
<a href="index.php" onMouseOver="MM_showHideLayers('Menu1','','show')">View Basket</a> and change it to
Code: [Select]
<a href="https://www.paypal.com/cart/business={$CONFIG['paypal_email']}&display=1">View Basket</a>
~fareforce
http://www.AlaskaStudio.com
I am modifying the heck out of igames.. I will post on a seperate thread when all mods are complete. It will incorperate several mods people are doing..  ;D
Title: Re: add a Paypal shopping basket to your gallery.
Post by: mgraf on January 12, 2005, 07:29:29 pm
What would be the best way to add this mod to an already existing gallery with a customized theme?

I have already tweaked my gallery quite a bit, and wouldn't want to erase anything by simply overwriting files.

Mark

My gallery:  http://www.grafphoto.com/gallery/index.php

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on January 13, 2005, 09:02:59 am
you will have to use a diff vieweer to find out the differences between an unmodified theme (from the standard coppermine package) and the same theme that comes with the hack. Then apply all changes to your cutomized theme as well. A good diff viewer on Windoze is WinMerge (http://winmerge.sf.net), Lunix usually comes with a built-in diff viewer.

Joachim
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 13, 2005, 10:54:23 am
No need for a diff viewer.  The download contains all the instructions for adding the code needed to an already modified install.

Open docs/Code-changes.html for these instructions.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 17, 2005, 11:49:37 am
Received from lu-x via pm;

Quote
Hi - I hope this is the right place for this request...

I am trying to set up your shop hack. Now there are these paypal buttons in the theme.
Is there an easy way to use the FILENAME rather than the TITLE in this button [I need a unique identifier]:

<input type="hidden" name="item_name" value="{TITLE}, size '{$CONFIG['size1']}'">

Is there a variable which I could use [I am not into php]
Thanx.

First, no, the correct place to ask questions on this hack is here.  Read my signature.

And a quick look at this thread, even the recent posts from zfolk and my reply would have shown this is already included.  Both the title and filename are sent via the paypal form.

Why don't you test, and then come back if you have any further questions.
Title: possible fault with shop hack mod
Post by: equi on January 19, 2005, 04:17:37 pm
ive been away for a while so apologies if this has been notified and/or discussed...The shop hack is spot on for use where only one theme is to be utilised, however ....with regard to shop hack using different albums, on caspers test site the option exists to buy posters framed or unframed upto A3 and buy wedding photos as posters.  This is possible when linking to the images via Last Uploads....Most Viewed etc...The system remembers the last theme used and only changes the theme if the album is navigated to directly.

This seems to nulify the use of different prices, sizes etc as I was able to purchase an eagle poster in  A3 GOLD for £69.99.  It might be me doing something wrong but just thought id raise the point, not that I could correct it, but is worth noting, if people plan to use the hack in this manner.

Cheers
Title: Re: add a Paypal shopping basket to your gallery.
Post by: gab696 on January 20, 2005, 08:56:49 pm
I use the Hardwired theme for my gallery and i want to change the "originals" Paypal buttons.
I have tried with the method from Fareforce in a previous post but i can't find this code in the harwired theme.php:
Code: [Select]
<a href="index.php" onMouseOver="MM_showHideLayers('Menu1','','show')">View Basket</a>
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 21, 2005, 01:06:44 am
Find this;

Code: [Select]
<span class="topmenu"><table><tr><td><!--  view basket button  -->
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value='{$CONFIG['paypal_email']}'>
<input type="image" src="https://www.paypal.com/en_GB/i/btn/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1">
</form> </td><td>
                        <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
<!-- BEGIN my_gallery -->

And change it to this;

Code: [Select]
<span class="topmenu">
                        <table border="0" cellpadding="0" cellspacing="0">
                                <tr>

<td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleftmy" src="themes/hardwired/images/buttonleftmy.gif" width="17" height="25" border="0" id="buttonleftmy" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter.gif">
                                                <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a>
                                        </td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0" id="buttonright" alt="" /></td>

<!-- BEGIN my_gallery -->

Then find this;

Code: [Select]
<!-- END logout -->
                                </tr>
                        </table></td></tr></table>
<?span>

And change it to this;

Code: [Select]
<!-- END logout -->
                                </tr>
                       </table>
                </span>
Title: Re: possible fault with shop hack mod
Post by: Casper on January 21, 2005, 01:21:01 am
 Posted by: gab696
Quote
I use the Hardwired theme for my gallery and i want to change the "originals" Paypal buttons.
I have tried with the method from Fareforce in a previous post but i can't find this code in the harwired theme.php:
Code:
<a href="index.php" onMouseOver="MM_showHideLayers('Menu1','','show')">View Basket</a>



Yes, you are correct, and I totally forgot about that.

If using the complex shop hack, where you have different prices on different albums, you cannot include these albums in any meta albums.  The easiest way around this is to remove all links to the meta albums.

Moving this to the shop hack thread.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: gab696 on January 21, 2005, 09:20:15 am
Casper, i'am not sure that you have correctly understand my question ( Maybe of my poor english. excuse me :-\\ )

I have carrefully made the changes with your instructions but now a second "My Gallery" button as replaced the "View Basket" button...

I don't want to remove anything but only replace the provided paypal buttons with others gif pictures.





Title: Re: add a Paypal shopping basket to your gallery.
Post by: lu-x on January 21, 2005, 10:58:11 am
Hi!
I hope this is the right place to ask this:

How can I change the paypal buttons in a way that not the TITLE is put into the field but the current FILENAME.
I tried without success.

Thank you for answering!
Ludwig
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 21, 2005, 11:12:08 am
Please be more specific about where you want the filename to show.  It is already included in the information gathered by the paypal button.
Title: Re: possible fault
Post by: equi on January 21, 2005, 12:42:40 pm
>Yes, you are correct, and I totally forgot about that.
>
>If using the complex shop hack, where you have different prices on different albums, you cannot include these albums in any meta albums.  The easiest way around this is to >remove all links to the meta albums.
>
>Moving this to the shop hack thread.
 
Can you briefy decribe what are the meta albums and their use, also how you remove the links to them

cheers
 
Title: Re: GAB696; change paypal buttons (shop hack)
Post by: equi on January 21, 2005, 12:51:25 pm
GAB696

with regard to replacing OEM gifs provided by paypal

find... src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif"

         src="https://www.paypal.com/en_GB/i/btn/view_cart_02.gif"

 in your newly modified theme.php  and replace with the paths to your own gif images
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 21, 2005, 01:00:27 pm
The 'meta' albums are the random, lastup etc albums.  You can remove them by removing lastup,2 and random,2 from your contents of main page in config.

You will also need to edit your theme.php to edit out the links in the menus, such as 'Last uploads :: Last comments :: Most viewed :: Top rated :: My Favourites :: Search.

How you do this depends on the theme in use, but in classic, just find this code;

Code: [Select]
<a href="{LASTUP_TGT}">{LASTUP_LNK}</a> ::
                        <a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a> ::
                        <a href="{TOPN_TGT}">{TOPN_LNK}</a> ::
                        <a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a> ::
                        <a href="{FAV_TGT}">{FAV_LNK}</a> ::
                        <a href="{SEARCH_TGT}">{SEARCH_LNK}</a>

And change it to this;

Code: [Select]
<!--<a href="{LASTUP_TGT}">{LASTUP_LNK}</a> ::
                        <a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a> ::
                        <a href="{TOPN_TGT}">{TOPN_LNK}</a> ::
                        <a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a> ::
                        <a href="{FAV_TGT}">{FAV_LNK}</a> ::
                        <a href="{SEARCH_TGT}">{SEARCH_LNK}</a>-->
Title: Re: add a Paypal shopping basket to your gallery.
Post by: equi on January 21, 2005, 01:13:32 pm
Thanx :)
Title: Re: add a Paypal shopping basket to your gallery.
Post by: gab696 on January 23, 2005, 11:47:17 pm
Thank you equi for your answer !

Now i have a another problem to place exactly my buttons where i want.
In Firefox it's all ok but in IE6 i can't succeed to place the "view basket" button in the right place. (view attached picture)
It seems to be caused by this lines in the theme.php

Code: [Select]
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value='{$CONFIG['paypal_email']}'>
<input type="hidden" name="display" value="1">

demo gallery www.gfphoto.net/coppermine/displayimage.php?album=10&pos=0 (http://www.gfphoto.net/coppermine/displayimage.php?album=10&pos=0)
this is the code used to place the button ;
Code: [Select]
$template_main_menu2 = <<<EOT
                <span class="topmenu">
                        <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
<!-- BEGIN album_list -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
<!-- END album_list -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{LASTUP_TGT}">{LASTUP_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{TOPN_TGT}">{TOPN_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{FAV_TGT}">{FAV_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{SEARCH_TGT}">{SEARCH_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <!--  view basket button  -->
      <td>
      <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
                                        <input type="image" src="themes/hardwired/images/viewbag.gif" width="48" height="21" border="0"border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
    <input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value='{$CONFIG['paypal_email']}'>
<input type="hidden" name="display" value="1">
</form></td>
                                </tr>
                        </table>
                </span>
EOT;



Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 24, 2005, 10:14:59 am
Try changing it to this;

Code: [Select]
$template_main_menu2 = <<<EOT
                <span class="topmenu">
<table border="0" cellpadding="0" cellspacing="0">
                                <tr>
<td>
                        <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
<!-- BEGIN album_list -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
<!-- END album_list -->
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{LASTUP_TGT}">{LASTUP_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{TOPN_TGT}">{TOPN_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{FAV_TGT}">{FAV_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
                                        <td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft1" src="themes/hardwired/images/buttonleft1.gif" width="7" height="25" border="0" id="buttonleft1" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter1.gif">
                                                <a href="{SEARCH_TGT}">{SEARCH_LNK}</a>
                                        </td>
                                        <td><img name="buttonright1" src="themes/hardwired/images/buttonright1.gif" width="7" height="25" border="0" id="buttonright1" alt="" /></td>
</tr></table>
</td>
                                        <!--  view basket button  -->
      <td>
      <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
                                        <input type="image" src="themes/hardwired/images/viewbag.gif" width="48" height="21" border="0"border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
    <input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value='{$CONFIG['paypal_email']}'>
<input type="hidden" name="display" value="1">
</form></td>
                                </tr>
                        </table>
                </span>
EOT;
Title: Re: add a Paypal shopping basket to your gallery.
Post by: gab696 on January 24, 2005, 10:29:21 am
Thanks Casper!  It's better but i have always a little shift upwards... (only in IE6)
The "hidden type" from the code seems to take place under the view baskett button what creates a second line.

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 24, 2005, 11:08:03 am
Try changing the very first<td> in the section, before the second <table.., to '<td valign="top">
Title: Album Title To Show up in The PayPal Cart...
Post by: dondo521 on January 25, 2005, 09:51:31 pm
First of all this is a great mod. It's so good in fact that because of it and the great features of Coppermine, that I switched over from Gallery to this.
However I am having the same question as I see a few others are on this post.

I have been trying to figure out how to add the Album title in the cart so it would come up as:
Whatever Family,'DSCF5064.jpg', 4x5@ $5.00

This is what I start with in theme.php
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="{$CONFIG['paypal_email']}" />
<input type="hidden" name="item_name" value="Photo Name : {TITLE}" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="currency_code" value="{$CONFIG[currency]}" />

and this is what I have tried:
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="{$CONFIG['paypal_email']}" />
<input type="hidden" name="item_name" value="Photo Name : {TITLE}" />
<input type="hidden" name="album" value="Filename : {FILENAME}" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="currency_code" value="{$CONFIG[currency]}" />

and then I tried:
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="{$CONFIG['paypal_email']}" />
<input type="hidden" name="item_name" value="Photo Name : {TITLE}" />
<input type="hidden" name="album_title" value="Filename : {FILENAME}" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="currency_code" value="{$CONFIG[currency]}" />


As you can see I tried to put in "album" and then "album_title" as a field, but still a no-go...
I also tried to add a new field and give that a name but again it didn't work...

The reason for wanting to do this is because I will be uploading many different albums and don't want to manually add a name to each one as that would take forever to do. Sometimes I might upload as many as 500 photos a day. This way if I can use the album or rather album title field it will take care of that tedious chore.

Am I close? On the right track? Do I need to modify anything else besides theme.php?
Is this even possible?

Thanks for your help!
dondo521
Title: Re: add a Paypal shopping basket to your gallery.
Post by: fareforce on January 26, 2005, 08:23:26 am
Ok.. I have any interesting question/problem..  I need to set up this hack so it has dynamically linked dropdown boxes for the checkout. Can you use Java inside of php? I was trying but couldn't get it to work..


So in a nutshell I need it so when someone selects the size "8"x10"  it will bring up "glossy" or "matte" in the next one then it will generate the price for paypal..
Title: Re: Album Title To Show up in The PayPal Cart...
Post by: Casper on January 26, 2005, 10:34:56 am
Am I close? On the right track? Do I need to modify anything else besides theme.php?
Is this even possible?

You are editing the wrong line of code.  To add the album name into the paypal form, do the following changes;

Find this line in theme.php;
Code: [Select]
<input type="hidden" name="basedes" value="Photo Name, '{TITLE}', Filename, '{FILENAME}'" />
Change it to this;
Code: [Select]
<input type="hidden" name="basedes" value="Album Name, '{ALBUM_TITLE}', Photo Name, '{TITLE}', Filename, '{FILENAME}'" />

Now, edit your displayimage.php (the one that came with the mod).  Find;

Code: [Select]
$params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $pic_html,
        '{ADMIN_MENU}' => $picture_menu,
        '{TITLE}' => $CURRENT_PIC_DATA['title'],
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
'{FILENAME}' => $CURRENT_PIC_DATA['filename'],
        );

and change it to;

Code: [Select]
$params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $pic_html,
        '{ADMIN_MENU}' => $picture_menu,
        '{TITLE}' => $CURRENT_PIC_DATA['title'],
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
'{FILENAME}' => $CURRENT_PIC_DATA['filename'],
'{ALBUM_TITLE}' => $CURRENT_ALBUM_DATA['title'],
        );
Title: Re: add a Paypal shopping basket to your gallery.
Post by: equi on January 26, 2005, 03:54:16 pm
quick query, i notice i have 2 differnet pieces of code for ReadForm, can u clarify if they have different effects on output or just the same (each contains slight variations on formulas)....thanx

VERSION 1

function ReadForm (obj1) { // process un-named selects
var i,amt,des,obj,pos,val;
  amt = obj1.baseamt.value*1.0;       // base amount
  des = obj1.basedes.value;           // base description
  for (i=0; i<obj1.length; i++) {     // run entire form
    obj = obj1.elements;           // a form element
    if (obj.type == "select-one" &&   // just get selects
        obj.name == "") {             // must be un-named
      pos = obj.selectedIndex;        // which option selected
      val = obj.options[pos].value;   // selected value
      pos  = val.indexOf ("@");       // price set?
      if (pos >= 0) amt = val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("+");       // price increment?
      if (pos >= 0) amt = amt + val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("%");       // percent change?
      if (pos >= 0) amt = amt + (amt * val.substring (pos + 1)/100.0);
      if (des.length == 0) des = val;
      else des = des + ", " + val;    // accumulate value
    }


VERSION 2

function ReadForm (obj1) { // process un-named selects
var i,amt,des,obj,pos,val;
  amt = obj1.baseamt.value*1.0;       // base amount
  des = obj1.basedes.value;           // base description
  for (i=0; i= 0) amt = val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("+");       // price increment?
      if (pos >= 0) amt = amt + val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("%");       // percent change?
      if (pos >= 0) amt = amt + (amt * val.substring (pos + 1)/100.0);
      if (des.length == 0) des = val;
      else des = des + ", " + val;    // accumulate value
    }
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 26, 2005, 05:25:44 pm
They both have the same effect.  The shorter version should have been carried forward when I updated this hack, but the older longer version crept back in.  But as I said, they both work.

EDIT;

The above is incorrect.  It is the shorter version that has caused some users to have the 'amount greater than zero' bug.

Please ensure you use the original, longer version.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: dondo521 on January 26, 2005, 08:25:38 pm
Man I can't thank you enough Casper! This was driving me crazy... ;)

Just so people know I ended up entering this in theme.php
<input type="hidden" name="basedes" value="Name, '{ALBUM_TITLE}', Photo No., '{FILENAME}'" />

instead of:
<input type="hidden" name="basedes" value="Album Name, '{ALBUM_TITLE}', Photo Name, '{TITLE}', Filename, '{FILENAME}'" />

The reason being is that when I upload my files the .jpg number(or filename like DSCF5063.jpg)  is the FILENAME for each photo

It was redundant if I added  Photo Name, '{TITLE}' as well...

Confused yet? lol! It sure can be!

Thanks again Casper!

dondo521
Title: Re: add a Paypal shopping basket to your gallery.
Post by: dobermin on January 31, 2005, 11:21:15 pm
Casper, thank you for the great work on this enhancement...you are awesome.

I do have one question thou --- it appears this hack only works when viewing the photos through the actual album vs. clicking on an individual thumbnail picture in the random picture, top viewed, last uploaded, etc....if you click on the image via any of these other routes, the price drop down box is not present.

I guess I have one more question.... is there anyway to integrate more than one paypal account.....I have two photographers posting their images on the same coppermine site....

Thank you again,

Paul

 
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on February 01, 2005, 12:13:36 am
First, do not pm supporters, or use their own websites to contact them, for coppermine support.  This is where we do the support.

The meta albums should work, and do on my test site.  The only problem is if you are using the theme switch option to nhave different prices on different albums.  Then you have to disable the meta albums.

You could use the same method as the different prices to use a different theme for each photographer, and hard code each ones paypal account in the theme.php by replacing '{$CONFIG['paypal_email']}' with the actual email addresses.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: dobermin on February 01, 2005, 03:01:08 am
Yeah, sorry about that Casper -- once I read the fine print I posted here on the forum.  Thanks for all the info everyone..  I love tinkering with this stuff...

I have everything working... I do have one other issue... I changed my user name within my Coppermine settings and I think it lead to my Titles to read "Picture; Title name here" -- it added the "Picture;" for some reason...any quick way to remove this?

Paul
Title: Re: add a Paypal shopping basket to your gallery.
Post by: trap on February 01, 2005, 08:13:45 am
Hello all

I am new to Coppermine and adding this great mod for the shopping cart.....all has been installed and up to a point is working brilliantly.  I'm not sure if it is me having something incorrect or if I have just missed something so any help would be appreciated. I have read this subject (yes all 10 pages) back to front however my knowledge of php and where to look first is a bit beyond me. I would really love this mod to be up and running as it is just what I need.

The Problem is this:

The mod is installed however when I click the view basket the Paypal page comes up with " The recipient of this shopping cart link is not an approved shopping cart user. Please review your selection and try again."   And yes I do have a business account registered with paypal and this email address had been put in the config section in the admin.  However when I go back to config section in Admin the Paypal email address has dissappeared.  Could this be something to do with the paypal error I am receiving?  Or have I done something wrong or missed something.  I have also tried hardcoding the email address into the theme.php file with no luck either.

Thanking you in advance

Trap  

Title: Re: add a Paypal shopping basket to your gallery.
Post by: alanuk on February 01, 2005, 08:50:03 am
Well, I successfully installed the Paypal shopping basket on my http://www.my-digitalphotos.co.uk/photos/index.php site and it works just great - but only on some of the albums! For example, none of the photos that I have tried in http://www.my-digitalphotos.co.uk/photos/thumbnails.php?album=4 album give you the option to buy photos, but others such as http://www.my-digitalphotos.co.uk/photos/thumbnails.php?album=14 are fine!

All the albums already existed before I installed the cart.

Any idea of why this should be, please?

Thanks

Alan
Title: Re: add a Paypal shopping basket to your gallery.
Post by: trap on February 01, 2005, 08:59:58 am
OOps,

Disregard my post earlier........must be my square eyes......found the problem...  I guess it goes to show you should read all the instructions.   I manually installed the sql file instead of running update.php   Amazing what happens when you do things correctly.  By the way Casper.....congratulations on this mod it is terrific.

Thanks anyway

Trap
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on February 01, 2005, 10:50:01 am
I changed my user name within my Coppermine settings and I think it lead to my Titles to read "Picture; Title name here" -- it added the "Picture;" for some reason...any quick way to remove this?

Your changes didn't cause this, it's part of the mod.

Just open your theme.php, and find 'Picture; {TITLE}', and just remove the word.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on February 01, 2005, 11:04:44 am
Well, I successfully installed the Paypal shopping basket on my http://www.my-digitalphotos.co.uk/photos/index.php site and it works just great - but only on some of the albums! For example, none of the photos that I have tried in http://www.my-digitalphotos.co.uk/photos/thumbnails.php?album=4 album give you the option to buy photos, but others such as http://www.my-digitalphotos.co.uk/photos/thumbnails.php?album=14 are fine!

Hi Alan,

just give the photos a title, that should cure the problem.  I thought I had cured this, try using the theme.php from this zip instead, http://www.picture-parade.co.uk/shop/albums/downloads/igames.zip

Remember to redo any changes you made.  Also, you have not removed the lines of code for the unused price options yet, so as you have 9 options, there are 11 options just showing 0.  It will look better without these.

By the way, what great photos.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: alanuk on February 01, 2005, 12:10:46 pm
Casper

Brilliant! Yes, giving the photos a title worked (although have only tried one - I'm at work). This was probably covered in the the instructions somewhere so please accept my apologies for not RTFM!

Thanks for kind comments about the photos and I know that I've yet to fully populate the list of sizes/proce options.

Thank you once again for the code and for your very quick response.

Alan
Title: Re: add a Paypal shopping basket to your gallery.
Post by: LiquidLife on February 09, 2005, 10:05:33 pm
This is the gallery: http://www.lifeforceliquid.com/coppermine/cpg132/

The admin account is "Liquid" and password is "xxxxxx"


I read the installation files, doing exactly as they instructed, but am still haveing a few minor problems. None of the images have anything to add them to the cart. Also, I am using the Mac_OS_X skin and the "view cart" button seems to overlap other details on the website. Is this something I just need to change with the format of the site or something? Thanks for your help!

~Jeff~
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Tranz on February 09, 2005, 10:09:29 pm
Please do not post admin level logins in public. I have edited out the password. You should still change the password for the account soon.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: LiquidLife on February 09, 2005, 10:16:08 pm
Alright. Sorry about that. I do not have anything serious on there yet, and have full backups of everything on my hard drive. I figured that getting the thing working was more important than the small security threat that poses at the moment.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on February 10, 2005, 10:16:29 am
Well, the add to basket button will show when you add titles to the pics.  If you don't want to do that, get the latest theme files from http://www.picture-parade.co.uk/shop/displayimage.php?pos=-71 which has this fixed.

There are posts in the last 2 pages of this thread on how to change the basket positioning.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Roshlin on February 17, 2005, 11:45:41 pm
Hi Casper,

Thanks for this excellent mod. Downloaded it from the link above and works great out of the box.

Just wanted to inform you that this mod works well with the postnuke mod pngpg. ( you have a note in the install instructions that it was not designed for nuke versions) no changes are needed.

To adapt fully to my site I would prefer to have the file path to the original image (fullsize) instead of the file name, so that when I receive the order I can download it by clicking on it. I want to use this to print user pics, so when I receive the order with the filename I don't know in which folder the image can be.

Also if you could tell me how to reduce the margin (or paddiing or width) of the outermost table in the singapore theme, becaue it is a little wider than the space I have for the theme, I use it inside postnuke as I mentioned earlier, I've tried reducing the padding values in the css with no luck. I am attaching 2 images so that you can see what I'm trying to say.

See the left image I want to reduce the white space just outside the thumnail table, otherwise it hides on the righthand side and produces an extra scroll bar. I know this has nothing to do with your script, but maybe you can help.

Some enhancement sugestions:
Maybe for the future versions you can come up with an idea to add a whole album to the cart which could ease a lot the task for user who want many prints.

An  option where users can pay and collect the prints from the store.

I don't think it will be possible for this version as it uses paypal pages, but maybe for some future version you may come up with.

Thanks again for this script, and keep up the good work.
Roshlin.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: skypix on February 18, 2005, 07:02:56 pm
Casper, just a fantastic job on this shopping hack.  I'm sure I'm speaking for every Copperminer who's implemented this hack when I say I'm grateful for your hours and hours of work, and responsiveness to the dozens of requests that came through on this thread. 

I'm a novice at php, don't even know how different files work together, but I followed your instructions, carefully, to the letter and it works like a dream.  I've got 10 price categories up on my site and it's working flawlessly.  Links to Paypal beautifully.  The only glitch is something I'm not sure how to fix: I've waded through the first 6 pages of this thread then my eyes and brain gave out, maybe you've already dealt with this but I suspect it's something I'm doing wrong in config...just don't know enough to be sure.

Also, do you accept contributions?  I know it's a community effort but since I'm a complete noob re coding, I'd like to kick in a little gratuity to sweeten your labors.

Attached is the screenshot of what's happening on the PayPal page:


Thanks again for doing something I'd never have been able to do on my own.

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on February 18, 2005, 07:57:41 pm
Hi Skypix,

all that means is you have not changed the displayimage.php with the one from the upload (or carried out the changes to it if you manually did the mod)

Just replace the one on your server with the one in the download.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: skypix on February 18, 2005, 08:12:17 pm
Yep, thanks, I must have missed that.  That did the trick, now it's just the way I want it.  Thanks Casper.


Something else I didn't have before I made the paypal upgrade: in the title bar of each image is the word "picture", I don't know where that came from.  Where can I switch that off?  I've searched through config but no luck.

thanks again, don't mean to be a pain.


Title: Re: add a Paypal shopping basket to your gallery.
Post by: romans815 on February 19, 2005, 06:34:58 am
Is there a way to allow the customer to enter additional comments into a text field once they have ckicked the "Add to Cart" button? So instead of haveing the option of paper type they acctually have a blank field in which tect could be entered.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on February 19, 2005, 08:49:13 pm
@ skypix,

open your theme.php and find the code below, just remove the 'picture:'

Code: [Select]
Picture; {TITLE}


@  romans815,

You can change the buttons to do anything you want, providing it is supported by paypal.

As far as I'm aware, you cannot have a text input directly with each add to basket button, but with the checkout.
You can add this line to add the additional info a user can give when checking out;

Code: [Select]
<input type="hidden" name="cn" value="Additional Info">
Put it in a line immediately before this line;

Code: [Select]
<input type="hidden" name="currency_code"...

To remove the paper selection just remove this code;

Code: [Select]
Paper&nbsp; &nbsp;
<input type="hidden" name="on0" value="Paper"><select name="os0"><option value="Glossy">Glossy<option value="Matt">Matt<option value="Satin">Satin</select>
&nbsp; &nbsp;
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Roshlin on February 20, 2005, 02:37:14 pm
Hi Casper,

I don't know if you missed this part of my post or is it not possible.

Quote
the file path to the original image (fullsize) instead of the file name

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on February 20, 2005, 05:26:24 pm
Hi Roshlin,

Open displayimage.php, and find;

Code: [Select]
$pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb');
And add in new line after;

Code: [Select]
$path_to_pic = $CONFIG['ecards_more_pic_target'] .$CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];

Now find;

Code: [Select]
'{FILENAME}' => $CURRENT_PIC_DATA['filename'],
'{ALBUM_TITLE}' => $CURRENT_ALBUM_DATA['title'],

Add after;

Code: [Select]
'{PATH}' => $path_to_pic,
Now open your theme.php, and find;

Code: [Select]
<input type="hidden" name="basedes" value="Album Name, '{ALBUM_TITLE}', Photo Name, '{TITLE}', Filename, '{FILENAME}'" />
Change it to;

Code: [Select]
<input type="hidden" name="basedes" value="{TITLE}, {PATH} " />
Title: Re: add a Paypal shopping basket to your gallery.
Post by: skypix on February 20, 2005, 08:17:21 pm
Thank you Casper, that did the trick!   ;D  Much obliged for all your hard work and helping out with whuffo questions (old hang gliding term, "whuffo you do this, whuffo you do that/"

The hack works like a dream on my system, Win 2K, PIV 3.0, 2 GB 400 DDR memory, Asus P4PE.



Title: Re: add a Paypal shopping basket to your gallery.
Post by: Roshlin on February 20, 2005, 11:12:44 pm
Hi Casper,

Thanks for your prompt reply, It works great.  ;)

It would be better and neater if the TITLE itself was a link, I tried using
<input type="hidden" name="basedes" value="<a href={PATH}>{TITLE}</a> " />
<input type="hidden" name="basedes" value="<a href="{PATH}">{TITLE}</a> " />
but they do not work

Thanks
Roshlin

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on February 21, 2005, 12:06:13 am
Yes, that simply will not work, but the email you get may have it automatically as a link.
If not, sorry, nothing you can do, afaik.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Flipper01 on February 25, 2005, 09:46:52 pm
I'm looking for the possibility that users can order pictures from my album. Because I have a lot of pictures in the gallery I only use low-res pictures, I want to make a sort of shopping basket so users can pick their favorite picture and send me the list so I can send them the high-res pictures. I don't want to use paypall or another service, I just want my users to click on the picture they like and then add it to a list of favorite pictures that they can print out or mail to me.

Do you know if this is possible with this hack or if its better to create a new one?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on February 25, 2005, 10:43:52 pm
No, not possible with this hack.

What you want is some mod that allows you to print the favourites as a list.  No such mod exists in my knowledge, so I suggest you ask on the support board if anyone knows how to do it.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: mgraf on March 04, 2005, 04:25:22 pm
Ok, I am getting ready to try this finally.   In my current page for print orders, I have a paypal code for shipping that looks like below.  This was suggested to me by Paypal tech support on how to handle increasing shipping costs if someone ordered many prints, but not overcharging them if they just ordered one.

Code: [Select]
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
                      <input type="hidden" name="cmd" value="_cart">
                      <input type="hidden" name="business" value="xxxx">
                      <input type="hidden" name="item_name" value="10x15 Print Only">
                      <input type="hidden" name="item_number" value="10x15P">
                      <input type="hidden" name="amount" value="xx.xx">
                      <input type="hidden" name="handling_cart" value="xx.xx">
                      <input type="hidden" name="shipping" value="x.00">
                      <input type="hidden" name="shipping2" value="x.00">
                      <input type="hidden" name="return" value="http://xxxxxxxx">
                      <input type="hidden" name="currency_code" value="USD">

Would I just duplicate this code above into the area of the mod (below) describing how to modify an existing theme? 
Code: [Select]
td valign="top"><form action="https://www.paypal.com/cgi-bin/webscr" method="post"
onsubmit="this.target = 'paypal';
          ReadForm (this);">
<p>
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="{$CONFIG['paypal_email']}" />
<input type="hidden" name="item_name" value="Photo Name : {TITLE}" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="currency_code" value="{$CONFIG[currency]}" />


<input type="hidden" name="baseamt" value="{$CONFIG['size1_price']}" />
<input type="hidden" name="basedes" value="Photo Name, '{TITLE}', Filename, '{FILENAME}'" />

 

would become this....

Code: [Select]
td valign="top"><form action="https://www.paypal.com/cgi-bin/webscr" method="post"
onsubmit="this.target = 'paypal';
          ReadForm (this);">
<p>
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="{$CONFIG['paypal_email']}" />
<input type="hidden" name="item_name" value="Photo Name : {TITLE}" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="handling_cart" value="xx.xx">
<input type="hidden" name="shipping" value="x.00">
<input type="hidden" name="shipping2" value="x.00">
<input type="hidden" name="currency_code" value="{$CONFIG[currency]}" />


<input type="hidden" name="baseamt" value="{$CONFIG['size1_price']}" />
<input type="hidden" name="basedes" value="Photo Name, '{TITLE}', Filename, '{FILENAME}'" />

 

Just trying to confirm this will not screw anything up.   I'll probably just go ahead and try it.

Mark
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 04, 2005, 06:02:18 pm
Yes, looks about right to me, but I havn't had time to test it.

Make sure you back up your files before testing.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: mgraf on March 04, 2005, 09:01:29 pm
Casper,
Seem to be having a problem... I think I got everything uploaded and modified correctly.  I used your instructions in modifying an existing theme.   When adding one of the print options to your cart, it takes me to the Paypal page - but has an error:

Quote
Please enter an amount greater than zero.

There is a small section of code for the theme.php mods that shows:

Code: [Select]
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="{$CONFIG['paypal_email']}" />
<input type="hidden" name="item_name" value="Photo Name : {TITLE}" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="currency_code" value="{$CONFIG[currency]}" />

The "amount" value="" seems strange, is this correct?

Not quite sure what is going on.  Any suggestions?

Here is the gallery:  http://www.grafphoto.com/gallery/index.php

ALSO - instead of the Picture {TITLE} being used as the description in the Paypal cart, can this be changed to the data for Custom Field 1?  Is theme.php the only place you would have to change this reference in the paypal code above?

Mark
Title: Re: add a Paypal shopping basket to your gallery.
Post by: l-nes on March 05, 2005, 01:02:20 am
hi all

Great hack.

I have one problem. I don't use any of the "normal" theme. I have many pictures with no title. I se that it is possible to download a "theme" where this is fixed. Can you explain where i have to make changes to my theme.

Thank you.

www.fotosalg.net

Lars E.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: netfalls on March 05, 2005, 05:09:06 pm
Hi all,


I was wondering if it's possible to set 3 or 4 different paypal adreess?

I would like each user to get his money directly.

Thanx
Philip

www.netfalls.com/portal2/ (http://www.netfalls.com/portal2/)
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 06, 2005, 04:22:17 pm
Casper,
Seem to be having a problem... I think I got everything uploaded and modified correctly.  I used your instructions in modifying an existing theme.   When adding one of the print options to your cart, it takes me to the Paypal page - but has an error:

Quote
Please enter an amount greater than zero.

There is a small section of code for the theme.php mods that shows:

Code: [Select]
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="{$CONFIG['paypal_email']}" />
<input type="hidden" name="item_name" value="Photo Name : {TITLE}" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="currency_code" value="{$CONFIG[currency]}" />

The "amount" value="" seems strange, is this correct?

Not quite sure what is going on.  Any suggestions?

Here is the gallery:  http://www.grafphoto.com/gallery/index.php

ALSO - instead of the Picture {TITLE} being used as the description in the Paypal cart, can this be changed to the data for Custom Field 1?  Is theme.php the only place you would have to change this reference in the paypal code above?

Mark


Not sure why your price is not being picked up.  Try loading the classic theme version of the hack and see if that works.

To use the user1 field, you will need to change the displayimage.php as well.

Use this in the code in theme.php to call it {USER1}

Then in displayinage.php, find;

Code: [Select]
'{FILENAME}' => $CURRENT_PIC_DATA['filename'],
'{ALBUM_TITLE}' => $CURRENT_ALBUM_DATA['title'],

and add into this array;

Code: [Select]
'{USER1}' => $CURRENT_PIC_DATA['user1'],
Title: Re: add a Paypal shopping basket to your gallery.
Post by: mgraf on March 06, 2005, 04:29:35 pm

Not sure why your price is not being picked up.  Try loading the classic theme version of the hack and see if that works.


Casper, I am not sure what this would do for me.  My theme is already extensively modified, and I wouldn't want the classic version.  If there are any files you would need to examine, I would be happy to send them.  I would really like to get this to work.

Still puzzled,

Mark
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 06, 2005, 04:30:41 pm
hi all

Great hack.

I have one problem. I don't use any of the "normal" theme. I have many pictures with no title. I se that it is possible to download a "theme" where this is fixed. Can you explain where i have to make changes to my theme.

Thank you.

www.fotosalg.net

Lars E.


Hi Lars,

please see this post and the answer, http://forum.coppermine-gallery.net/index.php?topic=13938.msg56555#msg56555
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 06, 2005, 04:31:30 pm

Not sure why your price is not being picked up.  Try loading the classic theme version of the hack and see if that works.


Casper, I am not sure what this would do for me.  My theme is already extensively modified, and I wouldn't want the classic version.  If there are any files you would need to examine, I would be happy to send them.  I would really like to get this to work.

Still puzzled,

Mark


It would see if the problem lies with your theme, or other parts of the code.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 06, 2005, 04:33:03 pm
Hi all,


I was wondering if it's possible to set 3 or 4 different paypal adreess?

I would like each user to get his money directly.

Thanx
Philip

www.netfalls.com/portal2/ (http://www.netfalls.com/portal2/)

No, not with this current mod.

There may well be a way to code it, but I don't know how.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: mgraf on March 06, 2005, 04:43:11 pm
It would see if the problem lies with your theme, or other parts of the code.

Ok, just updated the Classic theme and tried it - still get the same error for the shopping cart.
(By the way, I updated the PHP files using Dreamweaver.  Just cut and paste from your code instructions.  Can this play a part?)

Mark
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 06, 2005, 07:20:33 pm
Yes it can.

Dreamweaver, and any other wysiwyg editor can add bits of it's own code, which upsets the php code..

Zip up your theme.php and template.html, and attach them to your reply to this post, using the additional options.  If you cannot zip them, save them as txt files.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Tophux95 on March 06, 2005, 10:50:59 pm

 Hello,

 After Install , Update my site Web and create a paypal account, I always a msg error in the basket paypal :

      "The link you have used to enter the PayPal system contains an incorrectly formatted item amount."

 Do you want Help Me

 Tophux
Title: Re: add a Paypal shopping basket to your gallery.
Post by: l-nes on March 06, 2005, 10:55:01 pm
hi again

i have the same problem. I get an error saying amount must be larger then zero. I used UltraEdit to edit the php files. any ideas ?


Lars E.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 07, 2005, 12:43:22 am
@ Tophux95

please give a link to your site.  What currency do you use?  for instance, if using dollars, and the price is $10, then the setting for the price in config must be 10.00 not $10.00, or $10.

@ l-nes

Have you double checked your mod.  What theme are you using?  More info would help, as well as a link.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: l-nes on March 07, 2005, 08:27:39 am
Sorry for the poor inforamtion

My site: www.fotosalg.net. I am testing this out with currency = $, price is 50.00. I am useing the theme "digital flow". Everything else on the mod seems to be working.

In debug it says:
"Notice: Use of undefined constant currency - assumed 'currency' in /customers/fotosalg.net/fotosalg.net/httpd.www/bildearkiv/themes/digital_flow/theme.php on line 554
Notice: Use of undefined constant currency_symbol - assumed 'currency_symbol' in /customers/fotosalg.net/fotosalg.net/httpd.www/bildearkiv/themes/digital_flow/theme.php on line 561"

Line 554: <input type="hidden" name="currency_code" value="{$CONFIG[currency]}" />
Line 561: <option value="{$CONFIG['size1']} @{$CONFIG['size1_price']} ">{$CONFIG['size1']};    {$CONFIG[currency_symbol]}{$CONFIG['size1_price']}   </option>

Can this be the problem ?

Thx

Lars E
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 07, 2005, 08:46:44 pm
please attach a zip of the 2 theme files changed (or saved as txt files) so I can have a look.

Title: Re: add a Paypal shopping basket to your gallery.
Post by: netfalls on March 08, 2005, 02:00:26 pm
Hi guys,

I would like to know if it's possible to set a paypal address for each member and an option to select when uploading photo witch size are available.

My site http://stock.netfalls.com
Title: Re: add a Paypal shopping basket to your gallery.
Post by: mgraf on March 08, 2005, 04:28:09 pm
Yes it can.

Dreamweaver, and any other wysiwyg editor can add bits of it's own code, which upsets the php code..

Zip up your theme.php and template.html, and attach them to your reply to this post, using the additional options.  If you cannot zip them, save them as txt files.

Thanks for the offer Casper - but I took another route.  Since I could not get this one figured out, I went with an alternative that was actually a bit easier to implement, except it doesn't offer the Admin Config interface that this one has.   I went back and compared the DW modified PHP files in a plain text editor, and there didn't seem to be any differences between it and the Mod instructions.

Mark

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 08, 2005, 06:18:08 pm
Hi guys,

I would like to know if it's possible to set a paypal address for each member and an option to select when uploading photo witch size are available.

My site http://stock.netfalls.com

Neither of these requests are available with this mod.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Howard on March 13, 2005, 02:50:55 pm
Hey Casper,

Thanks for the great mod. I've got it running on my website without any trouble.

I have one small problem though. I run a website which is frequently updated with new photos, often 100s at a time. As other have noticed, it is not possible to view the "order form" without entering a Title & Description. Because I use the Batch Add option of Coppermine, these are all blank by default. As you can imagine, it would be very time consuming to manually enter a name and description for each one :(

So my question is, is it possible to make the input form for each image pass on the URL to the image instead of the title etc to PayPal? And with that, the order form would be shown on all new images by default (saving me from adding the details for each image).

Thanks in advance,

Howard
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 13, 2005, 04:35:20 pm
The add to basket problem has been fixed in the downloads available from my site, and the method to do it manually is on this thread, http://forum.coppermine-gallery.net/index.php?topic=13938.msg56555#msg56555

How to add the filepath to the basket info is at http://forum.coppermine-gallery.net/index.php?topic=13938.msg69854#msg69854

Title: Re: add a Paypal shopping basket to your gallery.
Post by: mikecheliak on March 17, 2005, 01:55:37 am
I am not a complete newbie to PHP/SQL but I am reletively new to Coppermine.  How do I install this hack?  I just need to be pointed in the right direction to get started.  I have downloaded the shop_update files and the themes but I am not sure where I have to upload these and what I do to change the paypal account information.  I am from Canada and also need to know if this will work with my account.

Thanks a MIL!!!

Mike Cheliak
Mostly a Photographer
Title: Re: add a Paypal shopping basket to your gallery.
Post by: mikecheliak on March 17, 2005, 02:59:47 pm
Disregard the above post...I found the instructions...sorry!

 :-[
Title: Re: add a Paypal shopping basket to your gallery.
Post by: mikecheliak on March 17, 2005, 03:30:19 pm
Tried to update SQL and got this error...any ideas

SQL-query:

ALTER TABLE `CPG_filetypes` DROP INDEX `EXTENSION` ,
ADD PRIMARY KEY ( `extension` )
MySQL said:  

#1091 - Can't DROP 'EXTENSION'. Check that column/key exists

Title: Re: add a Paypal shopping basket to your gallery.
Post by: mikecheliak on March 17, 2005, 08:13:02 pm
Nevermind again...found it!

Mike
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on March 18, 2005, 08:38:22 pm
That query does not exist in the update sql that comes with the mod.  Are you sure you replaced the sql/update.sql file with the one from the mod.

Also, are you sure you are using version 1.3.2 which was installed and working before the hack was applied?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Tim on March 23, 2005, 08:43:39 pm
We have just started using the gallery for business and this hack is perfect
thank you for making it.....

It is the final icing on the cake :D

[all we have to work out is how to make postage be added auto matically]
Title: Re: add a Paypal shopping basket to your gallery.
Post by: lcny on April 08, 2005, 12:28:17 am
Hi all,

I seem to be totally lost!!  I want to install this mod to a new CPG I just installed but after reviewing a few confusing threads and downloading two different zip files, I'm still baffled!   ???

I have downloaded :  cpg1.3.x_mod_shop_all_themes_only   &  shop-update

Neither come with instructions and I can't seem to find any update.php file.  

I currently use the hardwire template and would love it if someone could maybe give me the link to the most recent download for this mod and hopefully a link to the instructions.  

MANY THANKS!
Lisa

Steel Life Studios (http://www.steellifestudios.com)
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 08, 2005, 11:31:45 am
Actually, the 'shop_update.zip' comes with full instuctions.  They are in the docs folder, called shop.html

You can get the latest files from http://www.picture-parade.co.uk/shop/index.php where there is also a version for mals ecommerce.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: spence on April 08, 2005, 09:20:18 pm
Casper,

Does your "Alternate priced category" only display correctly in reynolds theme? Or is this only specific to your site's demo?

And can we count on you to port this hack to CPG 1.4 when it is available?

Thanks.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 09, 2005, 10:50:46 am
Hi spence,

that is just on my demo.  The way you would do it on your own site is to make a copy of your main theme, and use that, so for the visitor it would be seamless, and look exactly the same as the other pages.

I already have it working on a 1.4 install, there are a few changes to the files, but they will be posted, along with a full downloadable version, when 1.4 is released as stable.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: itrends on April 13, 2005, 06:15:22 pm
I want to use paypal but for individual orders, I dont wish to use the "basket", is there an easy way to implement a "buy now" for each image that runs via paypal for the checkout?

Cheers
Dave
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 14, 2005, 11:25:04 am
Should be quite easy.

Try this, change this line of code;

Code: [Select]
<input type="hidden" name="cmd" value="_cart" />
to this;

Code: [Select]
<input type="hidden" name="cmd" value="_xclick">

Now change this;

Code: [Select]
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" name="submit" alt="cart add" />

to this;

Code: [Select]
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">


You can then remove the view basket button from the theme.php file.

This is untested, but should work.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Tim on April 16, 2005, 03:48:14 pm
Can anyone help us?
for some unknown reason we have lost the selection process when you display the image, I have looked at the coding - but nothing has changed - PLEASE HELP :D
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Tim on April 17, 2005, 10:33:11 am
it's ok now, we have sorted it - thanks for this great hack :D
Title: Re: add a Paypal shopping basket to your gallery.
Post by: lcny on April 20, 2005, 11:05:26 am
Hi Casper,

I have the shop mod installed and I thought everything looked good until I got the "Please enter an amount greater than zero" error message that's been mentioned before.  I'm using the Hardwired theme and have no other modifications.  Also, ever since installing the Shop Mod, I can no longer log out.  Once I log in as admin I'm always logged in.  If I click on log out - it acts like it's logging me out, right down to "Bye bye", but then when it goes back to the main page I'm still logged in.

If you could help me out with these two problems, I'd be very grateful . . . and I am more than willing to pay you if you can help us resolve this.  We have an event we need to have on the web for sale by our promised date (which is now tomorrow) and I don't want to add any more pictures until I get this resolved.  

I'm sure you're as busy as I am, so if there's anything I can do to make it worth your while, please let me know by PM.  Also, I wasn't sure what files to include for you to look at, so if you'll let me know what you need to see, I'll zip them and post them  a.s.a.p.!

Thanks in advance for any help you can give us.  
This is a great mod!! (It just seems to be failing due to "user error")   :-\\
Lisa

EDIT: adding zip of theme.php and template.html
Title: Re: add a Paypal shopping basket to your gallery.
Post by: DobsonCentral on April 20, 2005, 09:11:55 pm
From what I can see, this looks like it will be a great mod.  The only issue I have is that it doesn't work for me yet.  I believe Lars had the same issue earlier in this thread, but I don't see the fix for this.  I'm using ver 1.3.2 and the Igames theme.  Without debug mode, with the paypal mod installed, I get an error on the page that says on Line 26, char 17, a semicolon is expected.  In debug mode, it tells me that there is a Use of Undefined Constant Currency_Symbol Assumed 'Currency_Symbol' in theme.php on lines 590 and 599 through 603.

Upon looking at the code, I thought I figured it out.  On the line that shows:

Code: [Select]
<input type="hidden" name="currency_code" value="{$CONFIG[currency]}" />
looks like it's missing the single quotes around currency.  Putting single quotes eliminates the error on this line.  Likewise where the code for all of your pricing is (20 or however many each person chooses to have), the single quotes are missing around currency_symbol.  Inserting the single quotes fixes these lines from having errors.  

Now comes the fun part, once all that is done, I start receiving the following errors:

Undefined variable: header in /insert path to theme here/mygallery/themes/igames-paypal1/theme.php on line 1475

Undefined variable: template_tab_display in /insert path to theme here/mygallery/themes/igames-paypal1/theme.php on line 1480

Undefined variable: lang_thumb_view in /insert path to theme here/mygallery/themes/igames-paypal1/theme.php on line 1483

Undefined index: inactive_tab in /insert path to theme here/mygallery/themes/igames-paypal1/theme.php on line 1484


If someone could post a fix for this, I'd greatly appreciate this.  I've been at this for two days now.  I'm hoping that whatever is causing these errors, is also causing nothing to be passed to Paypal.  Each time I've tried to add something to the cart, the cart remains empty when I'm pushed over to paypal.   As I said, I'm hoping these are all related somehow.

Thanks for any insight.  
Title: Re: add a Paypal shopping basket to your gallery.
Post by: tzastrow on April 21, 2005, 03:54:08 am
Hey everyone, im VERY new to coppermine and im trying to set up paypal to my website, im currently using the hardwood theme it and i was curious if it is even possible to incoporate the paypal feature to my site. When i downloaded the all_themes file it didnt have the hardwood theme in there so i wasent quite sure if i could do it or not

Any help would be greatly appreciated

Thanks
Tim
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 21, 2005, 07:16:56 am
I have the shop mod installed and I thought everything looked good until I got the "Please enter an amount greater than zero" error message that's been mentioned before.  I'm using the Hardwired theme and have no other modifications.

Hi Lisa,

the failure to get the amount is because your template.html does not have the javascript needed.  You have added some for stats, which may be the cause of your logout problem.

EDIT;, on visiting your site, I see your add to basket button is also missing.  I found this was because you had deleted the '</select>' tag  when you removed the unwanted selections.  I have added it in the attached zip.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 21, 2005, 07:20:25 am
Hey everyone, im VERY new to coppermine and im trying to set up paypal to my website, im currently using the hardwood theme it and i was curious if it is even possible to incoporate the paypal feature to my site. When i downloaded the all_themes file it didnt have the hardwood theme in there so i wasent quite sure if i could do it or not

Any help would be greatly appreciated

Thanks
Tim

Hi Tim,

the download for the hack itself(not the themes download) has a docs folder, and in there are a couple of html files you should read.  It is explained how to add this to other themes, or already customised themes.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 21, 2005, 07:37:08 am
From what I can see, this looks like it will be a great mod.  The only issue I have is that it doesn't work for me yet.  I believe Lars had the same issue earlier in this thread, but I don't see the fix for this.

Hi,

try replacing the javascript in template.html, as here.  Find;

Code: [Select]
<script type="text/javascript">
<!-- Hide JS source from HTML validators
function Dollar (val) {  // force to valid dollar amount
var str,pos,rnd=0;
  if (val < .995) rnd = 1;  // for old Netscape browsers
  str = escape (val*1.0 + 0.005001 + rnd);  // float, round, escape
  pos = str.indexOf (".");
  if (pos > 0) str = str.substring (rnd, pos + 3);
  return str;
}

function ReadForm (obj1) { // process un-named selects
var i,amt,des,obj,pos,val;
  amt = obj1.baseamt.value*1.0;       // base amount
  des = obj1.basedes.value;           // base description
  for (i=0; i<obj1.length; i++) {     // run entire form
    obj = obj1.elements[i];           // a form element
    if (obj.type == "select-one" &&   // just get selects
        obj.name == "") {             // must be un-named
      pos = obj.selectedIndex;        // which option selected
      val = obj.options[pos].value;   // selected value
      pos  = val.indexOf ("@");       // price set?
      if (pos >= 0) amt = val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("+");       // price increment?
      if (pos >= 0) amt = amt + val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("%");       // percent change?
      if (pos >= 0) amt = amt + (amt * val.substring (pos + 1)/100.0);
      if (des.length == 0) des = val;
      else des = des + ", " + val;    // accumulate value
    }
  }
  obj1.item_name.value = des;
  obj1.amount.value = Dollar (amt);
  if (obj1.tot) obj1.tot.value = "$" + Dollar (amt);
}
//-->
</script>

Replace it with;

Code: [Select]
<script type="text/javascript">
<!--
function Dollar (val) {  // force to valid dollar amount
var str,pos,rnd=0;
  if (val < .995) rnd = 1;  // for old Netscape browsers
  str = escape (val*1.0 + 0.005001 + rnd);  // float, round, escape
  pos = str.indexOf (".");
  if (pos > 0) str = str.substring (rnd, pos + 3);
  return str;
}

function ReadForm (obj1) { // process un-named selects
var i,amt,des,obj,pos,val,num="";
  amt = obj1.baseamt.value*1.0;       // base amount
  des = obj1.basedes.value;           // base description
  for (i=0; i<obj1.length; i++) {     // run entire form
    obj = obj1.elements[i];           // a form element
    if (obj.type == "select-one" &&   // just get selects
        obj.name == "") {             // must be un-named
      pos = obj.selectedIndex;        // which option selected
      val = obj.options[pos].value;   // selected value
      pos  = val.indexOf ("@");       // price set?
      if (pos >= 0) amt = val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("+");       // price increment?
      if (pos >= 0) amt = amt + val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("%");       // percent change?
      if (pos >= 0) amt = amt + (amt * val.substring (pos + 1)/100.0);
      pos  = val.indexOf ("#");       // item number?
      if (pos > 0) {                  //  yes
        num = val.substring (pos + 1);// get number, and rest of line
        val = val.substring (0, pos); // lop off some stuff
        pos = num.indexOf (" ");      // end it with space
        if (pos > 0) num = num.substring (0, pos);
      }
      if (des.length == 0) des = val;
      else des = des + ", " + val;    // accumulate value
    }
  }
  if (obj1.item_number && num.length > 0) obj1.item_number.value = num;
  obj1.item_name.value = des;
  obj1.amount.value = Dollar (amt);
  if (obj1.tot) obj1.tot.value = "$" + Dollar (amt);
}
//-->
</script>

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 21, 2005, 07:55:43 am
I'm using ver 1.3.2 and the Igames theme.  Without debug mode, with the paypal mod installed, I get an error on the page that says on Line 26, char 17, a semicolon is expected.  In debug mode, it tells me that there is a Use of Undefined Constant Currency_Symbol Assumed 'Currency_Symbol' in theme.php on lines 590 and 599 through 603.

Upon looking at the code, I thought I figured it out.  On the line that shows:

Code: [Select]
<input type="hidden" name="currency_code" value="{$CONFIG[currency]}" />
looks like it's missing the single quotes around currency.  Putting single quotes eliminates the error on this line.  Likewise where the code for all of your pricing is (20 or however many each person chooses to have), the single quotes are missing around currency_symbol.  Inserting the single quotes fixes these lines from having errors. 

Now comes the fun part, once all that is done, I start receiving the following errors:

Undefined variable: header in /insert path to theme here/mygallery/themes/igames-paypal1/theme.php on line 1475

Undefined variable: template_tab_display in /insert path to theme here/mygallery/themes/igames-paypal1/theme.php on line 1480

Undefined variable: lang_thumb_view in /insert path to theme here/mygallery/themes/igames-paypal1/theme.php on line 1483

Undefined index: inactive_tab in /insert path to theme here/mygallery/themes/igames-paypal1/theme.php on line 1484




Thanks for the info on the missing single quotes.  On my install I have no problem with parse errors, only the notices.  Putting in the single quotes in the '[currency]' and '[currency_symbol]' does remove these notices.

The remaining notices are nothing to worry about, and are nothing to do with the shop hack, they appear in the regular theme as well.  Just turn off the notices and debug mode.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: lcny on April 21, 2005, 09:32:13 pm

Hi Lisa,

the failure to get the amount is because your template.html does not have the javascript needed.  You have added some for stats, which may be the cause of your logout problem.

EDIT;, on visiting your site, I see your add to basket button is also missing.  I found this was because you had deleted the '</select>' tag  when you removed the unwanted selections.  I have added it in the attached zip.

Hi Casper,

Thanks so much for your help! The 'Add To Basket' is now working, which is what was most important, however I still can't log out.  Also, is there anyway to replace the buttons with something that fits the theme a little better.  I saw someone elses Paypal feature in his Coppermine gallery and his buttons for PayPal are gorgeous and really fit the page - it looks like it's built-in as opposed to an add-on.  You can see it at http://www.roweimages.com/ his gallery is under "Portfolio"
I know I've said it before, but I want to say it again because your help is truly appreciated . . . if I can pay you for your assistance, please just let me know!

Lisa

 
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 21, 2005, 10:37:07 pm
Hi Lisa,

The buttons on that site are actually just alternative ones supplied by paypal.  If you wish to use them, open your theme.php, and do as follows.

Find;

Code: [Select]
<input type="image" src="https://www.paypal.com/en_GB/i/btn/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
Change it to;

Code: [Select]
<input type="image" src="https://www.paypal.com/en_US/i/btn/view_cart.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
Then find this code;

Code: [Select]
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" name="submit" alt="cart add" />
and change it to;

Code: [Select]
<input type="image" src="https://www.paypal.com//en_GB/i/btn/sc-but-03.gif" name="submit" alt="cart add" />

You can use any image you want, you don't have to use paypals.  For instance, I recently did the ones below for a friend, using an online button creator.  You can use these or any other, by simply changing the url in the codes above to point to your own images.

Title: Re: add a Paypal shopping basket to your gallery.
Post by: bb123 on April 28, 2005, 11:18:01 am
Hi Casper

Thanks for a great addon ..

I have added paypal to my gallery .. almost.. on clicking the Add to basket button it goes to Paypa/ .. with my info the same when I click the View button
so its not adding to the basket my gallery is at http://www.postcardsoncd.com/coppermine/ .. with a couple pics in you can see how the buttons work ..

One other thing you may be able to help with is the View basket button is above the other buttons right side I have tried (with my limited knowledge of these things) to get it to come on the same line as the others and after the search button..

Thanks
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 28, 2005, 11:46:02 am
First, to get the add to basket to work, change the script in the template.html, as instructed on this post, http://forum.coppermine-gallery.net/index.php?topic=13938.msg79859#msg79859


To change the view basket button, do this.

Open theme.php, find, and delete this code;

Code: [Select]
<!--  view basket button  -->
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value='{$CONFIG['paypal_email']}'>
<input type="image" src="https://www.paypal.com/en_GB/i/btn/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1">
</form>


Then find this code;

Code: [Select]
EOT;
// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT

Now add, in a new line immediately BEFORE the 'EOT;'

Code: [Select]
<!--  view basket button  -->
<td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="button1_r1_c1" src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" id="button1_r1_c1" alt="" /></td>
                                        <td background="themes/rainy_day/images/button1_r1_c2.gif">
                                                <a href="https://www.paypal.com/cart/business={$CONFIG['paypal_email']}&display=1">View Basket</a>
                                        </td>
                                        <td><img name="button1_r1_c3" src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" id="button1_r1_c3" alt="" /></td>
Title: Re: add a Paypal shopping basket to your gallery.
Post by: bb123 on April 28, 2005, 05:29:05 pm
Thanks Casper

Looking a little better but created a few other problems .. found my way in again below is bug report slight feeling of being lost!!


USER:
------------------
Array
(
    [ID] => b09402a198e608f87ceb2571153fd586
    [am] => 1
    [liv] => Array
        (
            [sort] => na
)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_group] => 1
    [user_active] => YES
    [user_name] => postcard
    [user_password] => ********
    [user_lastvisit] => 2005-04-28 11:13:56
    [user_regdate] => 2005-04-23 04:49:16
    [user_group_list] =>
    [user_email] =>
    [user_website] =>
    [user_location] =>
    [user_interests] =>
    [user_occupation] =>
    [user_actkey] =>
    [disk_max] => 1024
    [disk_min] => 1024
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 3
    [ufc_min] => 3
    [custom_user_upload] => 0
    [num_file_upload] => 10
    [num_URI_upload] => 3
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 3
    [group_quota] => 1024
    [can_see_all_albums] => 1
    [group_id] => 1
    [groups] => Array
        (
            [1] => 1
        )

)

==========================
Queries:
------------------
Array
(
   
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 28, 2005, 07:05:23 pm
It all seems to be working fine for me.

The debug info you posted is useless without knowing the actual errors you are getting.  Please turn off debug, and notices, and then let me know when it goes wrong.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: bb123 on April 29, 2005, 10:30:53 am
Hi Casper

I am putting my line numbers so you can see before and after

Look like line 56 as all the pages I tried came up with a line 56 error.. so I guess its line 56!

The Paypal buttons are working great..

Thanks for your support its agreat addon to a great script




Index.php line 56 .. which is blank!
http://www.postcardsoncd.com/coppermine/

54    return template_eval($template, $params);
55}
56
57function get_subcat_data($parent, &$cat_data, &$album_set_array, $level, $ident = '')


thumbnails.php
http://www.postcardsoncd.com/coppermine/thumbnails.php?album=2

Line 56 again

55        $USER['search'] = '###' . $USER['search'];
56}
57}
58$album = $HTTP_GET_VARS['album'];


displayimage.php
http://www.postcardsoncd.com/coppermine/displayimage.php?album=2&pos=0


55{
56   global $CONFIG, $HTTP_SERVER_VARS, $HTTP_GET_VARS, $CURRENT_PIC_DATA, $PHP_SELF;
57    global $album, $cat, $pos, $pic_count, $lang_img_nav_bar, $lang_text_dir, $template_img_navbar;
58
59   $cat_link = is_numeric($album) ? '' : '&cat=' . $cat;

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on April 29, 2005, 10:46:35 pm
You still have not posted the actual error messages you are getting, and when I visit your site I get no errors.

What we need to see is the actual error message, which would say something like;

Warning; unable to......... on displayimage.php line 56 etc.,.

If all you see are notices, just do as I said and turn off debug mode and notices in your config.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Tarazed on April 30, 2005, 04:11:08 am
Hi Casper. I've used Coppermine for several galleries and now is the first time I've tried to add this shopping cart to it.  The problem is, rather than selling photographs, my client is selling paintings, therefore there are different prices for each one.  Is this possible to set through this hack, or am I going to have to find another way of doing it?

Any help would be appreciated.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: darren on May 01, 2005, 01:32:31 am
Hi Casper,

I can't figure out how to add Paypal shopping carts to my Coppermine gallery.  I have two galleries, one for stock photography downloads and one for private folders for customers to purchase prints.  I have already downloaded "shop-update" from WinRAR but I'm not sure how to use this program or how to use it with my Coppermine galleries.

Can I get directions?

thanks!

Darren Carter

Completely updated, 12/9/04

These is a mod that allow coppermine to use paypals shopping basket.

You can see a demo of this mod, and download the files HERE (http://www.picture-parade.co.uk/shop/index.php)

The updated mod uses just 1 line with dropdown boxes for all choices (up to 20 price options), and does this using javascript.  The original mod, which used a new line for each price option, is still available for download from the demo.  It has a neater basket, but has a maximum of 6 price options.

You can also download the files from the downloads section here.

There are easy to follow instructions included in the docs folder of the downloads. All that is required to convert a standard gallery is to use the enclosed files to overwrite the standard files, then run update.

The mod included sets all albums in the gallery to display exactly the same options with every image, but if you want to have different options available in different albums, the instructions are attached to this post, as complex_shop.txt.  This does require some code changes, but all is explained.


Please note, most of this thread is about earlier versions of the shop hack.  This post, and any after and including this one (http://forum.coppermine-gallery.net/index.php?topic=8703.msg47216#msg47216), are about this current, easy to apply hack.

You may find some helpful info and tips on the other posts though.

[attachment deleted by admin]
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Tarazed on May 01, 2005, 06:44:26 am
Woo hoo, nevermind.. I found that you had actually done exactly what I was looking for in another mod that works with mals-e.  Perfect.  Thanks a ton!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on May 01, 2005, 10:21:56 am
Darren, unzip the download, and there is a docs folder, which contains the instructions in the file shop.html
Title: Re: add a Paypal shopping basket to your gallery.
Post by: bb123 on May 01, 2005, 10:27:55 am
Hi Casper

All is looking ok the error message is when the pages are loaded bottom left corner confirms page is DONE: but with errors on page when I double click to see what the error is I get the messages which I put in my last post...  other than that all is working really well ... just bugging me that I cant find this error..

Thanks for your time and help
Title: Re: add a Paypal shopping basket to your gallery.
Post by: darren on May 01, 2005, 03:23:29 pm
Hey Casper,

Thanks for the directions.  When I open "shop-update" a box pops up that says I need to register with WinRAR in the next forty days.  When I click to register on their website I get these options:

Buy WinRAR archiver
 Buy WinRAR and shareware CD NEW! 
 Buy FAR file manager
 Browse all products

But I'm not sure what I need.  Can you help?

Darren


Completely updated, 12/9/04

These is a mod that allow coppermine to use paypals shopping basket.

You can see a demo of this mod, and download the files HERE (http://www.picture-parade.co.uk/shop/index.php)

The updated mod uses just 1 line with dropdown boxes for all choices (up to 20 price options), and does this using javascript.  The original mod, which used a new line for each price option, is still available for download from the demo.  It has a neater basket, but has a maximum of 6 price options.

You can also download the files from the downloads section here.

There are easy to follow instructions included in the docs folder of the downloads. All that is required to convert a standard gallery is to use the enclosed files to overwrite the standard files, then run update.

The mod included sets all albums in the gallery to display exactly the same options with every image, but if you want to have different options available in different albums, the instructions are attached to this post, as complex_shop.txt.  This does require some code changes, but all is explained.


Please note, most of this thread is about earlier versions of the shop hack.  This post, and any after and including this one (http://forum.coppermine-gallery.net/index.php?topic=8703.msg47216#msg47216), are about this current, easy to apply hack.

You may find some helpful info and tips on the other posts though.

[attachment deleted by admin]
Title: Re: add a Paypal shopping basket to your gallery.
Post by: darren on May 01, 2005, 07:25:23 pm
Hey Casper,

I also need to know how I'm suppose to list images that customers can pay for and download directly from my website to their computer.  Where are the directions for that?

Thanks!

Darren Carter


Completely updated, 12/9/04

These is a mod that allow coppermine to use paypals shopping basket.

You can see a demo of this mod, and download the files HERE (http://www.picture-parade.co.uk/shop/index.php)

The updated mod uses just 1 line with dropdown boxes for all choices (up to 20 price options), and does this using javascript.  The original mod, which used a new line for each price option, is still available for download from the demo.  It has a neater basket, but has a maximum of 6 price options.

You can also download the files from the downloads section here.

There are easy to follow instructions included in the docs folder of the downloads. All that is required to convert a standard gallery is to use the enclosed files to overwrite the standard files, then run update.

The mod included sets all albums in the gallery to display exactly the same options with every image, but if you want to have different options available in different albums, the instructions are attached to this post, as complex_shop.txt.  This does require some code changes, but all is explained.


Please note, most of this thread is about earlier versions of the shop hack.  This post, and any after and including this one (http://forum.coppermine-gallery.net/index.php?topic=8703.msg47216#msg47216), are about this current, easy to apply hack.

You may find some helpful info and tips on the other posts though.

[attachment deleted by admin]
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on May 02, 2005, 05:39:31 pm
Darren,

the winrar stuff is nothing at all to do with this hack or coppermine, but because you are using an un-registered version of winrar as your zip program.

You need to get yourself a zip program, such as winzip, winrar, or there are some free ones available.

using this mod, all images are available.  There are ways around this, using the 'complex' method, but then it is specific albums that are not sold, so it's easy enough to put that in the album description.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: darren on May 03, 2005, 12:31:39 am
Thanks for the help, Casper!  Is there a support phone number at Coppermine that I can call if I need anymore help and want to talk to a live person?



Completely updated, 12/9/04

These is a mod that allow coppermine to use paypals shopping basket.

You can see a demo of this mod, and download the files HERE (http://www.picture-parade.co.uk/shop/index.php)

The updated mod uses just 1 line with dropdown boxes for all choices (up to 20 price options), and does this using javascript.  The original mod, which used a new line for each price option, is still available for download from the demo.  It has a neater basket, but has a maximum of 6 price options.

You can also download the files from the downloads section here.

There are easy to follow instructions included in the docs folder of the downloads. All that is required to convert a standard gallery is to use the enclosed files to overwrite the standard files, then run update.

The mod included sets all albums in the gallery to display exactly the same options with every image, but if you want to have different options available in different albums, the instructions are attached to this post, as complex_shop.txt.  This does require some code changes, but all is explained.


Please note, most of this thread is about earlier versions of the shop hack.  This post, and any after and including this one (http://forum.coppermine-gallery.net/index.php?topic=8703.msg47216#msg47216), are about this current, easy to apply hack.

You may find some helpful info and tips on the other posts though.

[attachment deleted by admin]
Title: Re: add a Paypal shopping basket to your gallery.
Post by: darren on May 06, 2005, 12:35:28 am
Hey Casper,

Well, I purchased the zip program from WinRAR and I'm all set up now, but when I went to shop-update to the theme.php to change the print sizes and paper type it won't let me delete the lines I don't need.

what am I doing wrong now?

Darren


Completely updated, 12/9/04

These is a mod that allow coppermine to use paypals shopping basket.

You can see a demo of this mod, and download the files HERE (http://www.picture-parade.co.uk/shop/index.php)

The updated mod uses just 1 line with dropdown boxes for all choices (up to 20 price options), and does this using javascript.  The original mod, which used a new line for each price option, is still available for download from the demo.  It has a neater basket, but has a maximum of 6 price options.

You can also download the files from the downloads section here.

There are easy to follow instructions included in the docs folder of the downloads. All that is required to convert a standard gallery is to use the enclosed files to overwrite the standard files, then run update.

The mod included sets all albums in the gallery to display exactly the same options with every image, but if you want to have different options available in different albums, the instructions are attached to this post, as complex_shop.txt.  This does require some code changes, but all is explained.


Please note, most of this thread is about earlier versions of the shop hack.  This post, and any after and including this one (http://forum.coppermine-gallery.net/index.php?topic=8703.msg47216#msg47216), are about this current, easy to apply hack.

You may find some helpful info and tips on the other posts though.

[attachment deleted by admin]
Title: Re: add a Paypal shopping basket to your gallery.
Post by: cnico88 on May 06, 2005, 04:29:39 pm
so, is this shop hack still available for download? can I get a link to it please?
Thanks!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on May 06, 2005, 04:41:10 pm
@ darren, have you actually unzipped and extracted the files to a new folder on your hard drive?

@cnico88, you can get them from the downloads section here, or from my demo site, which may be more up to date, http://www.picture-parade.co.uk/shop/
Title: Re: add a Paypal shopping basket to your gallery.
Post by: darren on May 07, 2005, 01:42:28 am
Hey Casper,

I am assuming that I did unzip the files and those files are in a folder on my desktop.  but for some reason the file "theme.php" is trying to open itself in Microsoft Picture It.  I get this:

File C:/DOCUME~1/Owner/Locals~1/temp/Rar$DI170750/theme.php could not be opened.

I have no idea why it's trying to open in Picture It and it does not give me an option to open with another program.



Completely updated, 12/9/04

These is a mod that allow coppermine to use paypals shopping basket.

You can see a demo of this mod, and download the files HERE (http://www.picture-parade.co.uk/shop/index.php)

The updated mod uses just 1 line with dropdown boxes for all choices (up to 20 price options), and does this using javascript.  The original mod, which used a new line for each price option, is still available for download from the demo.  It has a neater basket, but has a maximum of 6 price options.

You can also download the files from the downloads section here.

There are easy to follow instructions included in the docs folder of the downloads. All that is required to convert a standard gallery is to use the enclosed files to overwrite the standard files, then run update.

The mod included sets all albums in the gallery to display exactly the same options with every image, but if you want to have different options available in different albums, the instructions are attached to this post, as complex_shop.txt.  This does require some code changes, but all is explained.


Please note, most of this thread is about earlier versions of the shop hack.  This post, and any after and including this one (http://forum.coppermine-gallery.net/index.php?topic=8703.msg47216#msg47216), are about this current, easy to apply hack.

You may find some helpful info and tips on the other posts though.

[attachment deleted by admin]
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on May 07, 2005, 12:38:11 pm
Darren,

with all due respect, your questions are not about thie shop hack, or even coppermine, but about the basic use of your computer.
You cannot just save any file to your desktop, and double click it, and expect windows to know what it is and how to deal with it.  Windows needs to be told which program to use for which type of files.

First, learn how to extract files from a zip. Extract the complete download to a folder such as c\my downloads\coppermine\shop.

Then open individual files using a plain text editor, such as notepad (not word) and use that to edit them.

And you don't have to quote that post of mine every time you post.

Title: Re: add a Paypal shopping basket to your gallery.
Post by: cnico88 on May 09, 2005, 04:36:53 pm
Hey Casper Thanks for the link. I guess I saw that on the 1st page but I saw this: [attachment deleted by admin] and it threw me off. Thanks!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: cnico88 on May 11, 2005, 02:13:20 am
sry for dbl post but that was couple days ago, anyways:

I installed the shop hack, modified all the files with the new ones. Now when I go into admin mode and I click the config and edit the paypal address and picture sizes, currency and so forth I I click save, the things says: saved succesfully but when I look at the pictures the picture sizes are not there and when I go back to Config I get empty fields there. I tried a bunch of times but it just won't save. I want to do it this way but if there is no other way then I could get instructions on how to edit the code. I am familiar with HTML, some Javascript and VB.NET but nothing about PHP so I would need some help, my site, if you want to take a look at it to get an idea is located at: www.cincophoto.com
Thanks for your help... ;D
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on May 11, 2005, 11:58:42 am
Are you sure you replaced the update.sql with the one in the package, and when all the files where done, did you run update.php?

The instructions for changing the files manually are in the download, in the docs/Code-changes.html.

EDIT. I just browsed to your site, and ran update.php.  The changes needed where added, which means you had not done that before.

It should work correctly now.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: cnico88 on May 11, 2005, 04:59:16 pm
I think everything works now so far except that under the payment option and picture size I only want 3 options but it shows all 10 of them and the other 7 with ; so take a look at www.cincophoto.com ans see what I am talking about. Would I need to kill the other 7 arrays in the file? Pls help,
Thanks in advance!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on May 11, 2005, 09:43:01 pm
Quote from: instructions in download, docs/shop.html
Now delete all the lines refering to options you are not using, i.e., if you are allowing 6 choices of size, remove, or edit out, the lines for options 7 - 20.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: cnico88 on May 12, 2005, 01:09:50 am
I resolved that and now I would like to know if I can somehow change the View Basket button to mach my theme. I have Hardwired theme and I want the button to like like that.  8)

BTW if you are interested if you want to sell your own pictures you must first make an account at my site ( www.cincophoto.com ) upload them and I will get 15% of your profit since I run the site. Thanks for checking out my website, I will try to update it every day. Thanks,
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on May 12, 2005, 12:22:52 pm

To change the view basket button, do this.

Open theme.php, find, and delete this code;

Code: [Select]
<!--  view basket button  -->
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value='{$CONFIG['paypal_email']}'>
<input type="image" src="https://www.paypal.com/en_GB/i/btn/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1">
</form> </td><td>


Then find this code;

Code: [Select]
<!-- BEGIN my_gallery -->
Now add, in a new line immediately BEFORE it, but after the '<tr>';

Code: [Select]
<!--  view basket button  -->
<td><img name="spacer" src="images/spacer.gif" width="5" height="25" border="0" id="spacer" alt="" /></td>
                                        <td><img name="buttonleft" src="themes/hardwired/images/buttonleftmemb.gif" width="17" height="25" border="0" id="buttonleft" alt="" /></td>
                                        <td background="themes/hardwired/images/buttoncenter.gif">
                                                <a href="https://www.paypal.com/cart/business={$CONFIG['paypal_email']}&display=1">View Basket</a></td>
                                        <td><img name="buttonright" src="themes/hardwired/images/buttonright.gif" width="7" height="25" border="0" id="buttonright" alt="" /></td>
Title: Re: add a Paypal shopping basket to your gallery.
Post by: cnico88 on May 13, 2005, 05:16:31 am
So if I want to add more buttons of my own to look jus like that but below all the main ones on the top where in the code line do I insert them?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on May 13, 2005, 09:10:59 pm
That question has nothing to do with the shop mod, so should not be asked here.

There have been plenty of posts about how to do this, but if you can't find it by searching, please post in the correct place, the support boards.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: cnico88 on May 16, 2005, 02:27:35 am
now, I modified the button that says view basket, now I jus want to edit the button that says: Add to basket to be in the same way. Again I am using Hardwired theme for CPG. Thanks
Title: Re: add a Paypal shopping basket to your gallery.
Post by: divernj on May 17, 2005, 05:41:12 am
I have followed the directions here and I am getting stuck once I click the "let's continue" text after running the update. I am presented with the following error message:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/divernj/public_html/gallery/themes/rainy_day/theme.php on line 954

Am I missing a semi-colon  or " somewhere? Any help would be greatly appreciated.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on May 17, 2005, 10:41:30 am
without knowing what changes you made to the file, it's impossible to say for sure.
Have you tried with an un-edited file.

Post full details of your set-up, and attach a copy of your theme.php, re-named to theme.txt.

Title: Re: add a Paypal shopping basket to your gallery.
Post by: MichielD on May 17, 2005, 03:07:20 pm
Hi all,

Mayby it's a silly question... In that case I'm so sorry...  ;)

I'm going to set up Coppermine for a friend. He's a semi-professional photographer. He has no intentions to open a PayPal account, but still wants to use some sort of 'ordersystem'.

In other words: I'm looking for a system that allows users to order a photo directly, via e-mail. Shopping basket: yes - Checkout: no, just a simple mailmessage with the ordered photo's and address details.

Is that possible? Is there a system available...?

Mike
Title: Re: add a Paypal shopping basket to your gallery.
Post by: divernj on May 17, 2005, 05:18:22 pm
I am using the rainy day theme. I tried using an unedited version after the update failed the first time. The only changes I have made are less size options (9) and no paper options. Thank you for your help.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: cnico88 on May 17, 2005, 11:59:25 pm
So can someone plz answer my question because if everything doesn't look the same my site will look unprofessional

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on May 20, 2005, 08:05:59 am
This is not a hotline, nor do you have a right that all your questions will be answered. Read http://coppermine.sourceforge.net/faq.php#lamesupport
Title: Re: add a Paypal shopping basket to your gallery.
Post by: cnico88 on May 22, 2005, 10:33:18 pm
This is not a hotline, nor do you have a right that all your questions will be answered. Read http://coppermine.sourceforge.net/faq.php#lamesupport

I was jus wondering if anybody knows how to answer my question since Casper helped with the code for the View Basket button, wouldn't the Add to cart button have a somewhat simillar code? Thanks in advance for your reply!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: RaptorUK on May 24, 2005, 12:41:47 pm
I considered using PayPal but instead used Photobox PrintButton,  I think they might be UK based only though.  They take the order,  print the photographs and handle the post,  very quick very good quality.  They take a 5% cut from your profit.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: zpeek on May 24, 2005, 10:00:45 pm
Is there a way were it can just email the information instead of using a paypal basket.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: rterburg on May 31, 2005, 11:33:33 pm
I've downloaded the PayPal mod yesterday and changed te code as discribed in the "code-changes.html" document. Everything works fine but I also get the Please enter an amount greater than zero. error.

I have read the options to solve this problem, but it doesn't work. I'm using Coppermine 1.3.3 and the Project_ii theme (modified). I have attached the theme.php and template.html in a zip file.

The url to the gallery on my website is http://www.terburg.net/gallery/index.php?lang=english

Can anyone help me?

Thanks in advance.

Regards, Ron
Title: Re: add a Paypal shopping basket to your gallery.
Post by: rterburg on June 01, 2005, 08:09:19 am
I've downloaded the PayPal mod yesterday and changed te code as discribed in the "code-changes.html" document. Everything works fine but I also get the Please enter an amount greater than zero. error.

I have read the options to solve this problem, but it doesn't work. I'm using Coppermine 1.3.3 and the Project_ii theme (modified). I have attached the theme.php and template.html in a zip file.

The url to the gallery on my website is http://www.terburg.net/gallery/index.php?lang=english

Can anyone help me?

Thanks in advance.

Regards, Ron

I've solved the problem. It was in my template.html. I took the original Project_ii template.html from the hack and modified it.
Thanks for the hack, it's a great one.

Regards, Ron
Title: paypal hack added, but no change to config.php [solved, please delete]
Post by: LWAA on June 02, 2005, 01:26:11 pm
 :-[ oops - found out what the problem was - I didn't update the english language file. All is good now.

I've added the PayPal hack and all seems good except that there's no settings available to change in config.php. According to the shopupdate docs, there should be two new sections in config.php between "Language, Themes & Charset settings" and "Album list view" entitled "Paypal account email" and Shop sizes and prices", but they are not there. I've double checked the shophack folder and there is no new config.php file. I've hit "update" and I see that all the info that should be in the new config.php file is listed there (paypal email address, paper sizes etc) but they don't show up in the config.php file - can anyone help please?
 :-\\
Title: Re: add a Paypal shopping basket to your gallery.
Post by: dukie on June 11, 2005, 05:28:35 am
I was also wondering if it would be possible to display the items added to cart on a page on your own server and then when the customer orders the items, to have the details emailed to the admin.  I would like the ability to have the users pay with cash or check or pick up the prints in person.

Any suggestions for completing this task?

Thanks
Title: Re: paypal hack added, but no change to config.php [solved, please delete]
Post by: cnico88 on June 13, 2005, 04:42:18 pm
:-[ oops - found out what the problem was - I didn't update the english language file. All is good now.

I've added the PayPal hack and all seems good except that there's no settings available to change in config.php. According to the shopupdate docs, there should be two new sections in config.php between "Language, Themes & Charset settings" and "Album list view" entitled "Paypal account email" and Shop sizes and prices", but they are not there. I've double checked the shophack folder and there is no new config.php file. I've hit "update" and I see that all the info that should be in the new config.php file is listed there (paypal email address, paper sizes etc) but they don't show up in the config.php file - can anyone help please?
 :-\\


I think you should go and update your coppermine now. So go to www.yourdomain.com/yourgallery/update.php where you replace your gallery and your domain to the appropriate names.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: ndee on June 16, 2005, 08:23:06 pm
hi casper, im currently using your wonderful paypal hack and is wondering whether i can customized it to have different prices for different photos upon uploading and when user adds to basket, the price of the photo is sent to paypal shopping cart...

if possible, what are the files to edit and modify to allow this feature of using different price ?? thanks in advance :)

Ndee.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: ndee on June 16, 2005, 10:53:29 pm
alright heres what i did:

1. added '{USER1}' => $CURRENT_PIC_DATA['user1'] in displayimage.php
-> this sets the user custom field as a parameter which can be used globally

2. changed the baseamt input in theme.php to: <input type="hidden" name="baseamt" value="{USER1}" />
-> this will sent the amount of the product to paypal

added beside the title:
{TITLE} - {$CONFIG[currency]}$ {USER1}
-> which will display the amount beside the title...

finally, edit the photo or upload a new photo of ur product and add the amount there...do note that inside config, user custom field 1 should have some description about the field like: Price: USD$

now the problem is how to allow values like 12.50 instead of 12 ? or 12.00 ? anyone can help??
Title: Re: add a Paypal shopping basket to your gallery.
Post by: ndee on June 16, 2005, 11:03:14 pm
hmm nvm, i guess everything is fixed.. :D thanks casper for the wonderful coppermine paypal hack.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: zac on June 20, 2005, 12:03:05 pm
Hi... Thanks so much for this fantastic hack!  Your support goes above and beyond!!
 I tried to read through all the posts but I can not find an answer to my problem.  In my galleries I have a mix of color and black and white images which also are printed either inkjet or hand printed fiber based and are priced accordingly.  These are mixed together in the same album.  Is there a way to make some pricing options unavailable for certain images (for example i can not print color images on fiber based papers).  

If there is a way it is probably way over my head but I thought I would ask just in case. ???  

Thanks again for the hack and any help with this.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: benoit on June 22, 2005, 11:48:20 am
Hi Casper,

I'm searching for a simple e-commerce solution, not using online payment like paypal.

My idea is that the end user can add pictures to his basket and then checkout. The order is notified by e-mail (or by another way?) to the admin and the client.
After this process, pictures are printed and sent to the customer with an invoice.

Is there a way to modify your paypal hack to do this ? What would be the solution ?

Thanks in advance
Benoit
Title: Re: add a Paypal shopping basket to your gallery.
Post by: djmac on June 26, 2005, 01:08:04 am
Casper

The MALS MOD, was it created just for MALS or can it be applied to any current CPG platform? I know this might be asking for a whole alot, but can the original print size and price fields be kept with it, and can time and labor be added, ie 15.00 per hour at 6 hours = 90.00.?
I guess I am asking if it can be more flexable. From what I see you do great work.

Regards
Don
Title: Re: add a Paypal shopping basket to your gallery.
Post by: sion3000 on June 29, 2005, 01:29:32 am
Maybe someone can help with this. Ive installed the pay pal mod with no problems and upgrade and running the current stable version.
Currently i have about 6 items in my drop down list for purchasing. e.g. A1 prints, A2, Prints A3 Prints and A4 prints

The only problem is that some of my photos on the site are not high enough quality to print above A4. So what i need to do is stop people from being able to select those print sizes on the photos i select.

I know you are able to do this on a catagory scale (each catagory gets its own theme) but i need a more specifc to the photo. ???
Any sugestions ? the site is www.coolshots.co.uk/Coppermine (http://www.coolshots.co.uk/Coppermine) if anyone needs to see what im talking about.

Any ideas welcome.  ;D ;D ;D

Thanks

Sion
Title: Re: add a Paypal shopping basket to your gallery.
Post by: djmac on June 29, 2005, 07:40:34 am
 Hi Sion

I'm not sure I can help, but I am curious. I looked at your site (looks great btw) When someone buys a print are they allowed to download the print itself in the size that they purchased. or do you create a print and mail it to them. If I had a better idea I may be of some help.  :)


Regards
Don
Title: Re: add a Paypal shopping basket to your gallery.
Post by: sion3000 on June 29, 2005, 09:53:17 am
Nope i do all the printing. The customers are not able to download the image. The only way forward i could see on this as the code stands is to create a different gallery e.g Mountains 1 and mountains 2. Mountains 2 would contain the bigger sizes and vice versa. But that would look a bit messy.

Whats your idea ?

THanks

Sion   :)
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Abboud on June 29, 2005, 02:32:48 pm
hi
first of all I would like to thank you so much for the add, but I have 2 questions

why do i get the message that the amount should be more than zero??? I have made evrything step by step as shown in the doc..


2: all my pictures are just exampels of what I can paint(I paint them manually by hand) so I need that the clients are able to choose the sizes and the colors and which motive they want then I will amke and ship it for them...How can I do that?? does it sound crazy??

here is the site and you can have a look!


thanks in advance
Title: Re: add a Paypal shopping basket to your gallery.
Post by: sion3000 on June 30, 2005, 01:15:00 am
Ok i have a solution to my problem with regards to different sizes per photo.

Not sure how much this work this would be but if Casper or someone else who codes here could have a think if its posible to add in the pay pal mod hack. I think it would also help other people.

1. Have a new configeration screen just for the pay pal hack
2. Allow it so you can create as many categorys  e.g. like is done with adding the albums
3. You are then able to edit up to 20 items / prices for each one of those paypal catagogires (works off the catagory ID)
4. In the photos section where you are able to edit its description you would have a paypal tick box which would then enable a drop down of all the catagories that, that photo would fall into. Thus providing only the items / prices you have set in that catagory.

This would solve the following problems:
1. People trying to esclude certain photos from the shop
2. People wishing to have more than 1 pricing scheme
3. My problem i face of not been able to edit items for each photo.


Anyway if someone could have a think of that and see if it would be considered. If they need more info on the idea please feel free to contact me.

Thanks

Sion   :)
Title: Re: add a Paypal shopping basket to your gallery.
Post by: djmac on June 30, 2005, 04:56:02 am
Quote
Nope i do all the printing. The customers are not able to download the image. The only way forward i could see on this as the code stands is to create a different gallery e.g Mountains 1 and mountains 2. Mountains 2 would contain the bigger sizes and vice versa. But that would look a bit messy.

Whats your idea ?

Sion

I think this is what I am reading in your post. It is quality in the image you are looking for. What I do is process all my photos through Adobe Photoshop. I make one image at about 800 by whatever. You will also have to increase the size of the images in the admin panel. This way the print looks good on screen and produces a nice thumbnail. Not sure if this helps.

Regards
Don

ps, what happen to casper. Where in the world is Casper  :)
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on June 30, 2005, 07:28:50 pm
Casper

The MALS MOD, was it created just for MALS or can it be applied to any current CPG platform? I know this might be asking for a whole alot, but can the original print size and price fields be kept with it, and can time and labor be added, ie 15.00 per hour at 6 hours = 90.00.?
I guess I am asking if it can be more flexable. From what I see you do great work.

Regards
Don

Don, that hack could be changed to use any shopping cart system I think, with a bit of coding.


Hi... Thanks so much for this fantastic hack!  Your support goes above and beyond!!
 I tried to read through all the posts but I can not find an answer to my problem.  In my galleries I have a mix of color and black and white images which also are printed either inkjet or hand printed fiber based and are priced accordingly.  These are mixed together in the same album.  Is there a way to make some pricing options unavailable for certain images (for example i can not print color images on fiber based papers). 

If there is a way it is probably way over my head but I thought I would ask just in case. ??? 

Thanks again for the hack and any help with this.

Try using the mals ecommerce hack, here (http://forum.coppermine-gallery.net/index.php?topic=14202.msg66138#msg66138)  but with the paypal forms instead of mals.  You will also have to put the script from the paypal hack in the theme template.html



Maybe someone can help with this. Ive installed the pay pal mod with no problems and upgrade and running the current stable version.
Currently i have about 6 items in my drop down list for purchasing. e.g. A1 prints, A2, Prints A3 Prints and A4 prints

The only problem is that some of my photos on the site are not high enough quality to print above A4. So what i need to do is stop people from being able to select those print sizes on the photos i select.

I know you are able to do this on a catagory scale (each catagory gets its own theme) but i need a more specifc to the photo. ???
Any sugestions ? the site is www.coolshots.co.uk/Coppermine (http://www.coolshots.co.uk/Coppermine) if anyone needs to see what im talking about.

Any ideas welcome. ;D ;D ;D

Thanks

Sion


Same answer as above.  Try using the mals commerce hack, here (http://forum.coppermine-gallery.net/index.php?topic=14202.msg66138#msg66138) , but using the paypal buttons.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on June 30, 2005, 07:52:53 pm
hi
first of all I would like to thank you so much for the add, but I have 2 questions

why do i get the message that the amount should be more than zero??? I have made evrything step by step as shown in the doc..

You will need to change the javascript in the theme template.html.  This has been discussed earlier in this thread several times.



2: all my pictures are just exampels of what I can paint(I paint them manually by hand) so I need that the clients are able to choose the sizes and the colors and which motive they want then I will amke and ship it for them...How can I do that?? does it sound crazy??

here is the site and you can have a look!


thanks in advance

You could also try the hack done for mals, but using the paypal buttons.  See link in above post.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on July 01, 2005, 12:30:54 am
OK,

I've seen the requests that are asking for a cross between this hack and the mals ecommerce one I did.

I have done one, that allows each photo to have up to 6 options, each at a different price if wanted.  It uses paypal as the payment gateway.

I will post it tomorrow, but you can preview it here (http://www.picture-parade.co.uk/shop2/index.php)

There is one photo with the features, and an album of screenshots.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: sion3000 on July 01, 2005, 01:27:50 am
Hi Casper that sounds perfect thanks for your input.

Whats the code like, just wondering because i will need to add more products to mine. Dont mind doing it myself aslong as you could give me a bit of guidence. 15 Products would be the maximum. Not sure if thats a quick change ?

Thanks

Sion
Title: Re: add a Paypal shopping basket to your gallery.
Post by: LWAA on July 05, 2005, 02:01:36 pm
I've added this hack (thanks!!) but when I select an option in the menu (eg 8x10 print $10), I'm taken to a paypal page and it says "please enter an amoutn greater than zero" even though the amounts are listed in the config file.
I noticed however, when I update the database, it says values are zero, and currency is GBP when IO specified in the config that it should use Can$. DO I need to duplicate my additions to the config file elsewhere, or change permissions to a file to allow the config page to write to it?

http://66.78.27.233/~basement/flrouiedscv3/

thanks!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on July 05, 2005, 04:19:26 pm
I've added this hack (thanks!!) but when I select an option in the menu (eg 8x10 print $10), I'm taken to a paypal page and it says "please enter an amoutn greater than zero" even though the amounts are listed in the config file.
I noticed however, when I update the database, it says values are zero, and currency is GBP when IO specified in the config that it should use Can$. DO I need to duplicate my additions to the config file elsewhere, or change permissions to a file to allow the config page to write to it?

http://66.78.27.233/~basement/flrouiedscv3/

thanks!

First, the ammount greater than zero problem has been discussed several times.  The answer is at http://forum.coppermine-gallery.net/index.php?topic=19491.msg79859#msg79859

Please search before asking.


When I visited your site it was showing the currency as Can$, so it seems you have fixed that.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: LWAA on July 05, 2005, 04:53:13 pm
thanks and sorry.

I swapped out the javascript code, but still get the same error. I updated the database too in case that was causing it.

When I go to Admin Tools and click on Update Database, I still see  £ and currency says GBP.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on July 05, 2005, 08:39:12 pm
thanks and sorry.

I swapped out the javascript code, but still get the same error. I updated the database too in case that was causing it.

When I go to Admin Tools and click on Update Database, I still see  £ and currency says GBP.


OK, there is a problem with your java script, with a load of funny characters.

This is what you should have;

Code: [Select]
<!--
function Dollar (val) {  // force to valid dollar amount
var str,pos,rnd=0;
  if (val < .995) rnd = 1;  // for old Netscape browsers
  str = escape (val*1.0 + 0.005001 + rnd);  // float, round, escape
  pos = str.indexOf (".");
  if (pos > 0) str = str.substring (rnd, pos + 3);
  return str;
}

function ReadForm (obj1) { // process un-named selects
var i,amt,des,obj,pos,val,num="";
  amt = obj1.baseamt.value*1.0;       // base amount
  des = obj1.basedes.value;           // base description
  for (i=0; i<obj1.length; i++) {     // run entire form
    obj = obj1.elements[i];           // a form element
    if (obj.type == "select-one" &&   // just get selects
        obj.name == "") {             // must be un-named
      pos = obj.selectedIndex;        // which option selected
      val = obj.options[pos].value;   // selected value
      pos  = val.indexOf ("@");       // price set?
      if (pos >= 0) amt = val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("+");       // price increment?
      if (pos >= 0) amt = amt + val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("%");       // percent change?
      if (pos >= 0) amt = amt + (amt * val.substring (pos + 1)/100.0);
      pos  = val.indexOf ("#");       // item number?
      if (pos > 0) {                  //  yes
        num = val.substring (pos + 1);// get number, and rest of line
        val = val.substring (0, pos); // lop off some stuff
        pos = num.indexOf (" ");      // end it with space
        if (pos > 0) num = num.substring (0, pos);
      }
      if (des.length == 0) des = val;
      else des = des + ", " + val;    // accumulate value
    }
  }
  if (obj1.item_number && num.length > 0) obj1.item_number.value = num;
  obj1.item_name.value = des;
  obj1.amount.value = Dollar (amt);
  if (obj1.tot) obj1.tot.value = "$" + Dollar (amt);
}
//-->
</script>



And this is what you have;

Code: [Select]
<!--
function Dollar (val) {Ý // force to valid dollar amount
var str,pos,rnd=0;
Ý if (val < .995) rnd = 1;Ý // for old Netscape browsers
Ý str = escape (val*1.0 + 0.005001 + rnd);Ý // float, round, escape
Ý pos = str.indexOf (".");
Ý if (pos > 0) str = str.substring (rnd, pos + 3);
Ý return str;
}

function ReadForm (obj1) { // process un-named selects
var i,amt,des,obj,pos,val,num="";
Ý amt = obj1.baseamt.value*1.0;Ý Ý Ý Ý// base amount
Ý des = obj1.basedes.value;Ý Ý Ý Ý Ý Ý// base description
Ý for (i=0; i<obj1.length; i++) {Ý Ý Ý// run entire form
Ý Ý obj = obj1.elements[i];Ý Ý Ý Ý Ý Ý// a form element
Ý Ý if (obj.type == "select-one" &&Ý Ý// just get selects
Ý Ý Ý Ý obj.name == "") {Ý Ý Ý Ý Ý Ý Ý// must be un-named
Ý Ý Ý pos = obj.selectedIndex;Ý Ý Ý Ý // which option selected
Ý Ý Ý val = obj.options[pos].value;Ý Ý// selected value
Ý Ý Ý posÝ = val.indexOf ("@");Ý Ý Ý Ý// price set?
Ý Ý Ý if (pos >= 0) amt = val.substring (pos + 1)*1.0;
Ý Ý Ý posÝ = val.indexOf ("+");Ý Ý Ý Ý// price increment?
Ý Ý Ý if (pos >= 0) amt = amt + val.substring (pos + 1)*1.0;
Ý Ý Ý posÝ = val.indexOf ("%");Ý Ý Ý Ý// percent change?
Ý Ý Ý if (pos >= 0) amt = amt + (amt * val.substring (pos + 1)/100.0);
Ý Ý Ý posÝ = val.indexOf ("#");Ý Ý Ý Ý// item number?
Ý Ý Ý if (pos > 0) {Ý Ý Ý Ý Ý Ý Ý Ý Ý //Ý yes
Ý Ý Ý Ý num = val.substring (pos + 1);// get number, and rest of line
Ý Ý Ý Ý val = val.substring (0, pos); // lop off some stuff
Ý Ý Ý Ý pos = num.indexOf (" ");Ý Ý Ý // end it with space
Ý Ý Ý Ý if (pos > 0) num = num.substring (0, pos);
Ý Ý Ý }
Ý Ý Ý if (des.length == 0) des = val;
Ý Ý Ý else des = des + ", " + val;Ý Ý // accumulate value
Ý Ý }
Ý }
Ý if (obj1.item_number && num.length > 0) obj1.item_number.value = num;
Ý obj1.item_name.value = des;
Ý obj1.amount.value = Dollar (amt);
Ý if (obj1.tot) obj1.tot.value = "$" + Dollar (amt);
}
//-->
</script>

See all those 'Y' like figures where there should be spaces.

And as for the currency, I suspect when you used the admin tools to update again, it reset it to default.

Just change it in config.  It is certainly showing Can$ in the dropdown boxes and codes.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: LWAA on July 05, 2005, 08:50:27 pm
ah! they look like little martini glasses !! Thanks.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Okie on July 06, 2005, 06:18:32 am
Hi Casper,
I need some help, please?  I've spent the last 4 days uploading, installing, deleting, reading, uploading, installing, and deleting.  I installed cpg133, and had it operating fine for a few weeks.  Then I saw Mal's paypal zip and downloaded it.  I followed the instructions meticulously but never could get things to work properly.  That's when I would delete cpg133 and begin again, trying to be more precise.  Well things have progressed to the point that today, alone, I have installed cpg133, and either Mal's mod, or yours, 4 times and deleted it 3 times.  The last time was this evening and I was sure I downloaded your most recent zip, including the 3 files that had been corrected.  I had already installed cpg133 and had it up and running, in a manner that appeared to be fine.  I downloaded the rainy-day theme you have already tweaked, added a button to my home page, changed the location of the "view basket" button, and uploaded it and everything else, as is.  I completed the operation with the update.php.
Now, my frustration.  There never is a PayPal section on the Configuration Menu.  I'm under the impression it should be there.  Also, the icons that indicate the result of a batch upload are never there either, but the files seem to be uploading just fine.
Will you see if you can help me?   http://okiedokiephotos.com/cpg133
Thanks!   :)
Carl
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on July 06, 2005, 12:37:14 pm
@ Carl,

I think you have mixed up the 2 paypal mods.

Please send me a pm, with an admin account login. 

Please also confirm which mod you are trying to use, the one with the same prices and options throughout the gallery, or the one where each item can be priced and optioned differently.

And if you want, your ftp log in, and I will install the mod you want for you.

Others please note, I'll only do that as it's my fault for not seperating the 2 different hacks.

I will split the 2 mods now into seperate threads.

Edit, the new mod, with options and prices set seperately for each item can now be found here (http://forum.coppermine-gallery.net/index.php?topic=19489.0)
Title: Re: add a Paypal shopping basket to your gallery.
Post by: nad13 on July 27, 2005, 12:33:56 pm
I English does not include/understand well... But I have reussi has to include Paypal with the MOD of Casper: -)  I have a problem as I want to add photographs?  

message :

Warning: exec() has been disabled for security reasons in /home/users/m/maltese13/www/photomaltese/albums/include/picmgmt.inc.php on line 162

Warning: chmod(): No such file or directory in /home/users/m/maltese13/www/photomaltese/albums/include/picmgmt.inc.php on line 224

Warning: getimagesize(albums/nb/thumb_16.jpg): failed to open stream: No such file or directory in /home/users/m/maltese13/www/photomaltese/albums/include/picmgmt.inc.php on line 226
Impossible de créer la vignette ou l'image réduite.


thank you for your assistance

Nadine
photographe FRANCE
http://www.photomaltese.com

coppermine  + Paypal here : http://www.photomaltese.com/albums

 :\'(
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on July 28, 2005, 06:05:04 am
not related to the paypal hack. The error message you get means that you can't use ImageMagick due to server-sided restrictions - use GD instead. For details, ask your webhost, or search this board for the error message you get (has been asked frequently). If this is a language issue, you're wlecome to post on the french support board (http://forum.coppermine-gallery.net/index.php?board=38.0).
Title: Re: add a Paypal shopping basket to your gallery.
Post by: nad13 on July 28, 2005, 12:09:39 pm
Thank you very much... 

It is GD x2 which goes: -) 

I do not know why it had become "image magic" in the configuration..
mauvaise handling

thank you : -) 

Nadine
Photographe France
 :D
http://www.photomaltese.com
Title: Re: add a Paypal shopping basket to your gallery.
Post by: artistsinhawaii on August 03, 2005, 12:33:22 pm
Great hack Casper. 

I'm totally new to HTML and PHP -- about three weeks!   The first week I spent trying all those other gallery software using java and html. All of them only allowed users to build one gallery with ONE category and maybe just ONE sub-category or album.   Then I discovered Coppermine! Then your hack! I not only got it installed on successfully on coppermine 1.33 but also on coppermine 1.4.  At this rate, I'll have my site up and running in a couple of weeks not months.

Thanks again.

Dennis
Title: Re: add a Paypal shopping basket to your gallery.
Post by: falki on August 11, 2005, 09:14:33 am
Hey Casper

Your hack is just great!
I have intergatet in my new "Foto Shop"
See it working at: http://www.magic-places.ch/canada/

Thanks a lot  :)
Falki
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on August 11, 2005, 10:50:32 am
Thanks madeinhawaii and falki,

It's always good to here that what you have done has helped others.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: zac on August 30, 2005, 04:32:33 am
 ??? what happened to the old version of this hack.. the one where every item had the same prices attached to them and the prices for everything is set in the config panel .  Now I only have the option to set the price for each individal item and there is nowhere to enter prices in config.  Feeling dense.. I have done this a couple of times before.  What am I missing?  I downloaded the hack from the downloads section where there is only this one version. 



 8) Nevermind I found it on an earlier post (page 5)

http://prdownloads.sourceforge.net/coppermine/cpg1.3.x_mod_shop_no_themes.zip?download
Title: Re: add a Paypal shopping basket to your gallery.
Post by: zac on August 30, 2005, 05:42:15 am
ok.. back with a ? that i dont think i can solve.  i installed the older version of your hack and everything seemed to work ok..

i have the options in the config now but nothing is showing up on the site.. no options, no buy it button..

test drive @ http://www.folkphotography.com/client_portraits/index.php

thanks for any help on this
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on August 30, 2005, 12:37:25 pm
Hi zac,

This used to happen when the photos had no title.  If this is what's causing it, there are posts about how to change the code.

Alternately, you could get the latest version of the first hack from my test site, at http://www.picture-parade.co.uk/shop/

If this doesn't fix it for you, please zip up your theme files and attach them to a posting here, for me to look at.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: zac on August 30, 2005, 09:19:34 pm
Thanks Capser!  They just needed titles.  Cheers!
Title: Re: add a Paypal shopping basket to your gallery.
Post by: djmac on August 31, 2005, 07:35:49 am
Casper

I recently sent you a PM. Ignore it. Here is my problem. Maybe you can help me. I have created a drop down menu using the following code. It works well but will not show the purchase information

Code: [Select]
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_number" value="Size"><input type="hidden" name="item_name" value="Print"><input type="hidden" name="cmd" value="_cart"><input type="hidden" name="add" value="1"><input type="hidden" name="business" value="me@anytown.com">

<!-- create drop down for the price -->
<!-- add as many selections as you need here
in the following format
<select name="amount">
<option value="dollaramount">nameshownindropdownlist</option>
.
.
.
<option value="x">x</option>
</select> -->

<select name="amount">
<option value="">Print Size and Price</option>
<option value="0.19">4x6 $0.19</option>
<option value="0.79">5x7 $0.79</option>
<option value="3.99">8x10 $3.99</option>
<option value="8.99">11x14 $8.99</option>
<option value="18.99">16x20 $18.99</option>
<option value="24.99">20x30 $24.99</option>
<option value="1.79">Wallet(4) $1.79</option>
<option value="1.69">Wallet(8) $1.69</option>
<option value="1.59">Wallet(12) $1.59</option>
<option value="1.49">Wallet(16) $1.49</option>


</select>
<input type="submit">

I get the following results. Under Item I get PRINT and #Size What I want to see is PRINT and 4x6 or 5x7 etc etc

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.imagemarket.biz%2Fimages%2Fcart.gif&hash=786f85b0cbe015b3cb851f5f500b7a4a7fcbddd2)       


Thanks in advance

Regards
Don McLaughlin
 
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on August 31, 2005, 12:26:42 pm
I was fully intending to ignore the pm, as per my signature.

But as you asked here, try this.  Change each option line from this;

Code: [Select]
<option value="0.19">4x6 $0.19</option>
to this;

Code: [Select]
<option value="4x6 @0.19">4x6 $0.19</option>
Title: Re: add a Paypal shopping basket to your gallery.
Post by: djmac on August 31, 2005, 12:35:00 pm
I was fully intending to ignore the pm, as per my signature.

But as you asked here, try this.  Change each option line from this;

Code: [Select]
<option value="0.19">4x6 $0.19</option>
to this;

Code: [Select]
<option value="4x6 @0.19">4x6 $0.19</option>



Sad to say I tried it and it comes back empty with an error that says:

The link you have used to enter the PayPal system contains an incorrectly formatted item amount.

Casper

I am going to bed. I have been up all night - its 6:54am  here I need to get some sleep. I really appreciate anything you can do for me

Best Regards
Don

ps, I just saw the signature. Won't happen again
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on August 31, 2005, 05:58:29 pm
There's a policy not to PM dev team members - not only Casper doesn't want to be PMed, but the whole team. You agreed to respect this policy when you signed up. Even if you haven't read Casper's signature, it's something that common sense should tell you: there's a reason for running a support board: support requests have to be public, so others can benefit from support requests as well. Trying to get individual support by PMing devs is selfish. You haven't respected board rules in the past (that's why you have a high negative karma record), so consider yourself warned: respect board rules in the future!

Joachim
Title: Re: add a Paypal shopping basket to your gallery.
Post by: raidahl on October 04, 2005, 03:00:26 pm
First of all I have to say Thank You to Casper for this grate hack.

But, I have a problem cause I am not a PHP coder, I have updated database with these options:

INSERT INTO CPG_config VALUES ('size1', '10x15');
INSERT INTO CPG_config VALUES ('size2', '13x17');
INSERT INTO CPG_config VALUES ('size3', '20x30');
INSERT INTO CPG_config VALUES ('size4', '30x40');
INSERT INTO CPG_config VALUES ('size5', '50x75');
INSERT INTO CPG_config VALUES ('size1_price', '5');
INSERT INTO CPG_config VALUES ('size2_price', '8');
INSERT INTO CPG_config VALUES ('size3_price', '20');
INSERT INTO CPG_config VALUES ('size4_price', '35');
INSERT INTO CPG_config VALUES ('size5_price', '75');
INSERT INTO CPG_config VALUES ('currency_symbol', '€');
INSERT INTO CPG_config VALUES ('currency', 'EUR');
INSERT INTO CPG_config VALUES ('paypal_email', ''); (do not care about this)

Problem is, that at my site I get from Dropdown menu (Choose the size and so on):
0;   0£
0;   0£
0;   0£
and so on, nothing else.

This is the code from theme.php

<select onchange = "ReadForm (this.form);">
<option value="{$CONFIG['size1']} @{$CONFIG['size1_price']} ">{$CONFIG['size1']}; &nbsp; &nbsp;{$CONFIG[currency_symbol]}{$CONFIG['size1_price']}</option>
.
.
.
and so on.
</select>

What is possibly wrong ?

Thanks forehead

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on October 04, 2005, 11:47:00 pm
edit the query to reflect your coppermine prefix.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: raidahl on October 05, 2005, 08:12:12 am
edit the query to reflect your coppermine prefix.

Sorry to say, but I don't quite follow your answer, mayby cause my english is not so fluent.
Could you please tell me more what should I do.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on October 05, 2005, 11:10:41 am
Change the database queries you have;

Code: [Select]
INSERT INTO CPG_config VALUES ('size1', '10x15');
INSERT INTO CPG_config VALUES ('size2', '13x17');
INSERT INTO CPG_config VALUES ('size3', '20x30');
INSERT INTO CPG_config VALUES ('size4', '30x40');
INSERT INTO CPG_config VALUES ('size5', '50x75');
INSERT INTO CPG_config VALUES ('size1_price', '5');
INSERT INTO CPG_config VALUES ('size2_price', '8');
INSERT INTO CPG_config VALUES ('size3_price', '20');
INSERT INTO CPG_config VALUES ('size4_price', '35');
INSERT INTO CPG_config VALUES ('size5_price', '75');
INSERT INTO CPG_config VALUES ('currency_symbol', '€');
INSERT INTO CPG_config VALUES ('currency', 'EUR');
INSERT INTO CPG_config VALUES ('paypal_email', '');

If you run these queries directly in the database, you need to change the 'CPG_' to what your tables actually have as the prefix.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: RazorsEdge on October 07, 2005, 05:27:19 am
I noticed in the shop version database alterations the line.......

Code: [Select]
INSERT INTO CPG_config VALUES ('size1', '10x15');
If you are using a fresh install of coppermine gallery, the CPG_config should actually be in lower case. cpg_config.

I was able to get mine working and I thank everyone here for thier help. I do have one small question that will help me complete my paypal gallery. I am currently not using 15 different sizes and prices and after updating the database and uploading it to the site, I now have the 2 sizes and prices I want to use plus 13 entries of 0;   0$ in the drop down menu. Is thier a command I could use to update the database to remove the additional tables?

Thanks in advance,

-Razors Edge-

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on October 07, 2005, 10:04:44 am
Hi,

just go into config, and clear the '0' from the unused entries, that should do it.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: RazorsEdge on October 07, 2005, 10:40:41 pm
Hi,

just go into config, and clear the '0' from the unused entries, that should do it.

I removed the 0 from the items and now get a ; $

Is thier anyway to get rid of those entries?

-Razors Edge-
www.verdantstudios.com/gallery

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on October 07, 2005, 10:48:40 pm
Open your theme/theme.php, and find this code;

Code: [Select]
Select size and frame here&nbsp; &nbsp;
<select onchange = "ReadForm (this.form);">
<option value="{$CONFIG['size1']} @{$CONFIG['size1_price']} ">{$CONFIG['size1']}; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size1_price']}&nbsp; &nbsp;</option>
<option value="{$CONFIG['size2']} @{$CONFIG['size2_price']}">{$CONFIG['size2']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size2_price']}&nbsp; &nbsp;</option>
<option value="{$CONFIG['size3']} @{$CONFIG['size3_price']}">{$CONFIG['size3']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size3_price']}</option>
<option value="{$CONFIG['size4']} @{$CONFIG['size4_price']}">{$CONFIG['size4']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size4_price']}</option>
<option value="{$CONFIG['size5']} @{$CONFIG['size5_price']}">{$CONFIG['size5']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size5_price']}</option>
<option value="{$CONFIG['size6']} @{$CONFIG['size6_price']}">{$CONFIG['size6']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size6_price']}</option>
<option value="{$CONFIG['size7']} @{$CONFIG['size7_price']}">{$CONFIG['size7']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size7_price']}</option>
<option value="{$CONFIG['size8']} @{$CONFIG['size8_price']}">{$CONFIG['size8']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size8_price']}</option>
<option value="{$CONFIG['size9']} @{$CONFIG['size9_price']}">{$CONFIG['size9']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size9_price']}</option>
<option value="{$CONFIG['size10']} @{$CONFIG['size10_price']}">{$CONFIG['size10']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size10_price']}</option>
<option value="{$CONFIG['size11']} @{$CONFIG['size11_price']} ">{$CONFIG['size11']}; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size11_price']}</option>
<option value="{$CONFIG['size12']} @{$CONFIG['size12_price']}">{$CONFIG['size12']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size12_price']}</option>
<option value="{$CONFIG['size13']} @{$CONFIG['size13_price']}">{$CONFIG['size13']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size13_price']}</option>
<option value="{$CONFIG['size14']} @{$CONFIG['size14_price']}">{$CONFIG['size14']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size14_price']}</option>
<option value="{$CONFIG['size15']} @{$CONFIG['size15_price']}">{$CONFIG['size15']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size15_price']}</option>
<option value="{$CONFIG['size16']} @{$CONFIG['size16_price']}">{$CONFIG['size16']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size16_price']}</option>
<option value="{$CONFIG['size17']} @{$CONFIG['size17_price']}">{$CONFIG['size17']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size17_price']}</option>
<option value="{$CONFIG['size18']} @{$CONFIG['size18_price']}">{$CONFIG['size18']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size18_price']}</option>
<option value="{$CONFIG['size19']} @{$CONFIG['size19_price']}">{$CONFIG['size19']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size19_price']}</option>
<option value="{$CONFIG['size20']} @{$CONFIG['size20_price']}">{$CONFIG['size20']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size20_price']}</option>
</select>

Just remove the lines for the extra options.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: RazorsEdge on October 07, 2005, 11:12:53 pm
Open your theme/theme.php, and find this code;

Code: [Select]
Select size and frame here&nbsp; &nbsp;
<select onchange = "ReadForm (this.form);">
<option value="{$CONFIG['size1']} @{$CONFIG['size1_price']} ">{$CONFIG['size1']}; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size1_price']}&nbsp; &nbsp;</option>
<option value="{$CONFIG['size2']} @{$CONFIG['size2_price']}">{$CONFIG['size2']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size2_price']}&nbsp; &nbsp;</option>
<option value="{$CONFIG['size3']} @{$CONFIG['size3_price']}">{$CONFIG['size3']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size3_price']}</option>
<option value="{$CONFIG['size4']} @{$CONFIG['size4_price']}">{$CONFIG['size4']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size4_price']}</option>
<option value="{$CONFIG['size5']} @{$CONFIG['size5_price']}">{$CONFIG['size5']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size5_price']}</option>
<option value="{$CONFIG['size6']} @{$CONFIG['size6_price']}">{$CONFIG['size6']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size6_price']}</option>
<option value="{$CONFIG['size7']} @{$CONFIG['size7_price']}">{$CONFIG['size7']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size7_price']}</option>
<option value="{$CONFIG['size8']} @{$CONFIG['size8_price']}">{$CONFIG['size8']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size8_price']}</option>
<option value="{$CONFIG['size9']} @{$CONFIG['size9_price']}">{$CONFIG['size9']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size9_price']}</option>
<option value="{$CONFIG['size10']} @{$CONFIG['size10_price']}">{$CONFIG['size10']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size10_price']}</option>
<option value="{$CONFIG['size11']} @{$CONFIG['size11_price']} ">{$CONFIG['size11']}; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size11_price']}</option>
<option value="{$CONFIG['size12']} @{$CONFIG['size12_price']}">{$CONFIG['size12']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size12_price']}</option>
<option value="{$CONFIG['size13']} @{$CONFIG['size13_price']}">{$CONFIG['size13']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size13_price']}</option>
<option value="{$CONFIG['size14']} @{$CONFIG['size14_price']}">{$CONFIG['size14']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size14_price']}</option>
<option value="{$CONFIG['size15']} @{$CONFIG['size15_price']}">{$CONFIG['size15']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size15_price']}</option>
<option value="{$CONFIG['size16']} @{$CONFIG['size16_price']}">{$CONFIG['size16']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size16_price']}</option>
<option value="{$CONFIG['size17']} @{$CONFIG['size17_price']}">{$CONFIG['size17']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size17_price']}</option>
<option value="{$CONFIG['size18']} @{$CONFIG['size18_price']}">{$CONFIG['size18']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size18_price']}</option>
<option value="{$CONFIG['size19']} @{$CONFIG['size19_price']}">{$CONFIG['size19']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size19_price']}</option>
<option value="{$CONFIG['size20']} @{$CONFIG['size20_price']}">{$CONFIG['size20']} ; &nbsp; &nbsp;{$CONFIG['currency_symbol']}{$CONFIG['size20_price']}</option>
</select>

Just remove the lines for the extra options.

As usual, You have helped out yet another person, I thank you for your help. It works perfectly.

-Razors Edge-

Title: Re: add a Paypal shopping basket to your gallery.
Post by: Ifmracin on October 10, 2005, 10:52:47 pm
New to this and am unable to get the purchase dropdown menu's to show up for the pictures in the theme Blackbirch.
I applied all the code as listed in docs/code-changes.html and am having no luck.

Did I do something wrong? Or is it just not working with that theme?

Gallery here:
www.ifmracing.com/gallery

Thank you in advance.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: artistsinhawaii on October 10, 2005, 11:16:51 pm
It's been a while since I used this paypal mod, but

set file info visible.

If I click on your (i) icon over your pics, I see the dropdown list.

Dennis
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Ifmracin on October 11, 2005, 12:49:39 am
Thanks,
But howcome it only shows for some albums and not others? ???
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Ifmracin on October 11, 2005, 01:01:41 am
Ok, with a little searching on here I figured out that it needs a title for the dropdowns to work.
So.......is there a way to insert titles when doing batch uploads? Or do I have to go to each file to add titles?



Also, and I did a search but came up empty. (the thread with the answer that was linked to is invlaid) I get "Please enter an amount greater than zero."  Help?


Thanks.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: artistsinhawaii on October 11, 2005, 01:48:20 am
Thanks,
But howcome it only shows for some albums and not others? ???

Try adding a title to the files that don't show the price.  See what happens.  If I recall correctly, it had something to do with this.

Dennis
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on October 11, 2005, 11:04:45 am
The 2 problems you mention were both addressed some time ago, and can easily be solved.

The answer to the 'amount greater than zero' problem is at http://forum.coppermine-gallery.net/index.php?topic=19491.msg79859#msg79859.

The problem of photos with no title not showing the dropdown lists etc is solved simply by moving the '<!-- END img_desc -->' tag, as discussed at http://forum.coppermine-gallery.net/index.php?topic=19491.msg56555#msg56555.


Side note,  the problem with smf is that when 2 threads are merged, it gives a completely new id, so all links to the old thread no longer work.  So if the link refers to an earlier post in the same thread, try replacing the topic id number with the current one, for example, this topic is currently id 19491, if the url in the address box above is different, change the 19491 in these links to match the topic id now shown.

Hope that is clear.

Title: Re: add a Paypal shopping basket to your gallery.
Post by: zac on November 08, 2005, 07:00:34 am
Hi there.. no matter how many times I install this thing I always have something I have to bug you about...

This install is weird.  I deleted all of the options in the theme to only leave 3 but all 20 still show up in the admin menu.  I enter my email and the prices but in the drop down menu nothing appears except a ;

When I return to the admin menu all  of the info I entered is gone.  Any idea on this?  I named all of the files so that is not the problem.

Thanks for any help with this.

Z
Title: Re: add a Paypal shopping basket to your gallery.
Post by: artistsinhawaii on November 08, 2005, 10:14:13 am
zac,

Use phpMyadmin or any other tool you have to check your database and see what fields have been added to your cpg_pictures table.  You should see all the fields or rows you installed and the $, USD, US fields as well.  If you do not, then you will have to repeat the steps to add them.  If you see more than you need, delete the ones that do not apply to your needs.

In your language file, also delete the fields you no longer require.  These should eliminate those fields from showing up in your CONFIG menu.

From Admin Tools in Cpg, run database update.  And see if that doesn't clear up any other issues you might still be experiences.

Remember, your file must have a title to display the dropdown list.

Dennis
Title: Re: add a Paypal shopping basket to your gallery.
Post by: zac on November 08, 2005, 06:11:18 pm
Thanks Dennis.   I think I will just try a clean install then when I get back  home.  THis may be due to the fact that I first tried your paypal hack and then didnt necessarily clean everything up before installing this one.  Probably not a good idea.

Cheers!

 
Title: Re: add a Paypal shopping basket to your gallery.
Post by: artistsinhawaii on November 08, 2005, 08:04:50 pm
Thanks Dennis.   I think I will just try a clean install then when I get back  home.  THis may be due to the fact that I first tried your paypal hack and then didnt necessarily clean everything up before installing this one.  Probably not a good idea.
 
Actually mine shouldn't interfere with this one at all.  Try the admin tools/update database again. That might just clear it up for you.

Dennis
Title: Re: add a Paypal shopping basket to your gallery.
Post by: zac on November 09, 2005, 04:31:28 am
Hmmm.. still no luck.  I did a new install of the theme and updated, everything is named.... Still when I enter my paypal email and the options and prices in the config page it does not save it.  ANy ideas on this?  I am running CPG 1.3.5 and the version of the Paypal Hack is for 1.3.3 if that makes any difference.   

THanks for all the help !  :)
Title: Re: add a Paypal shopping basket to your gallery.
Post by: artistsinhawaii on November 09, 2005, 05:54:06 pm
zac,

did you add the following to your update.sql file before running the database update?


#
#add shop fields for shop hack
#

INSERT INTO CPG_config VALUES ('paypal_email', '');
INSERT INTO CPG_config VALUES ('currency_symbol', '£');
INSERT INTO CPG_config VALUES ('currency', 'GBP');


ALTER TABLE `CPG_pictures` ADD `option1_name` varchar(50) default '' NOT NULL;
ALTER TABLE `CPG_pictures` ADD `option1_price` varchar(10) default '' NOT NULL;


ALTER TABLE `CPG_pictures` ADD `option2_name` varchar(50) default '' NOT NULL;
ALTER TABLE `CPG_pictures` ADD `option2_price` varchar(10) default '' NOT NULL;

ALTER TABLE `CPG_pictures` ADD `option3_name` varchar(50) default '' NOT NULL;
ALTER TABLE `CPG_pictures` ADD `option3_price` varchar(10) default '' NOT NULL;


ALTER TABLE `CPG_pictures` ADD `option4_name` varchar(50) default '' NOT NULL;
ALTER TABLE `CPG_pictures` ADD `option4_price` varchar(10) default '' NOT NULL;

ALTER TABLE `CPG_pictures` ADD `option5_name` varchar(50) default '' NOT NULL;
ALTER TABLE `CPG_pictures` ADD `option5_price` varchar(10) default '' NOT NULL;


ALTER TABLE `CPG_pictures` ADD `option6_name` varchar(50) default '' NOT NULL;
ALTER TABLE `CPG_pictures` ADD `option6_price` varchar(10) default '' NOT NULL;
Title: Re: add a Paypal shopping basket to your gallery.
Post by: zac on November 09, 2005, 08:44:06 pm
Thanks again Dennis... but.. no luck  ???
Title: Re: add a Paypal shopping basket to your gallery.
Post by: artistsinhawaii on November 10, 2005, 05:06:39 am
Thanks again Dennis... but.. no luck  ???

zac, with phpMyadmin, check your database cpg_config VALUES table. Do the following three entries exist?

('paypal_email', '');
('currency_symbol', '£');
('currency', 'GBP');

Dennis
Title: Re: add a Paypal shopping basket to your gallery.
Post by: zac on November 15, 2005, 05:05:36 am
Not sure .. sorry I dont really know what i am doing (you have probably gathered that by now  ???) I looked int the admin utilities -> Display PhP info... is that what you mean?  If so... I dont see it there.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: artistsinhawaii on November 15, 2005, 06:48:07 am
Not sure .. sorry I dont really know what i am doing (you have probably gathered that by now  ???) I looked int the admin utilities -> Display PhP info... is that what you mean?  If so... I dont see it there.

Sorry, no.  To access phpMyadmin, you must go to the admin utilities of your website, not coppermine. Look for the site management tools.  Some kind of database admin tool.  You need to browse the config table of your coppermine database to see if the updates you added to the database are being written to the database.

Dennis
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on November 15, 2005, 08:26:00 am
not all webhosting packages come with a tool like phpMyAdmin. You may have to install it on your own - get it here: http://www.phpmyadmin.net/
Title: Default Value
Post by: netfalls on November 15, 2005, 01:53:49 pm
Hi, I'd like to know if there is a way to have a default value for the prices

Most of my photographs have the same price and I'll just need another value for a few shots.
Thanx

http://www.netfalls.com
Title: Re: Default Value
Post by: artistsinhawaii on November 15, 2005, 07:22:49 pm
Hi, I'd like to know if there is a way to have a default value for the prices

Most of my photographs have the same price and I'll just need another value for a few shots.
Thanx

http://www.netfalls.com

netfalls,

This particular mod provides up to 20 prices that are shared with all pics, there is a complexshop.txt buried in the documents that outlines how to use an if/else statement to assign different prices to different albums but it's a little tricky and doesn't work with the lastup/toprated/favorites albums.

You may want to opt for the other paypal mod which can be found here. (sorry Casper)
http://forum.coppermine-gallery.net/index.php?topic=22357.msg108825#msg108825

Dennis
Title: Re: add a Paypal shopping basket to your gallery.
Post by: MIRROR on November 21, 2005, 12:23:23 am
Is this Mod been updated at all lately?

Never mind i found the other one now.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: jpconijn on January 06, 2006, 05:18:05 pm
Is this mod suitable for 1.4.3
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 07, 2006, 01:42:42 am
Is this mod suitable for 1.4.3

Yep, just finished it, and attached to this post.

Note to all, this is the shop version suitable only when all items have the same prices and options.  For sites wishing to sell a variety of types of product, this is not suitable, I suggest you try maidenhawaii's mods.

@ Gaugau, could you please add this to the available downloads for 1.4x.

Casper
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 07, 2006, 12:55:02 pm
I just realised I missed out the instructions for adding a 'view basket' link in the 1.4 mod attached above. 
To add the view basket link, simply use the custom link available in config/theme settings, and use the following as the url;

Code: [Select]
https://www.paypal.com/cart/business=your-paypal-email&display=1
Change the 'your-paypal-email' in the above to your actual one, and it should work fine.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: jpconijn on January 12, 2006, 12:43:11 am
I use xp_publish to upload my photo's to coppermine. I was wondering if there is an easy way to set the price structure per album instead of changing it file by file?

Thanks

Jan
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Casper on January 12, 2006, 09:46:26 am
jp,

I think you are on the wrong thread, as this mod has the same prices for every item in the gallery.  The mod with individually set prices is at http://forum.coppermine-gallery.net/index.php?topic=19489.0

But anyway, the answer is no, sorry.  There is a mod done by madeinhawaii for 1.3 and 1.4 that does make the pricing easier, and I have done a version of his mod for 1.4 I will be publishing soon which makes installation and admin of it even easier. 
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Gizmo on March 02, 2006, 10:58:49 pm
Hi Everyone,

I'm getting ready for the spring LAX season to start and wanted to create a new photo gallery for 2006. I've installed CPG 1.4.4 and edited the BlackBirch theme with my logo. I then downloaded the shop-hack-original-1-4-3.zip PayPal hack that Casper created and installed it according to the included docs. Everything worked fine except in the Config settings, it won't save my PayPal account email or the sizes and prices. When looking at the individual photos, the View Basket button is there as well as the drop down for the different selections but nothing is listed other than ;. I've searched the forum and can't seem to put my finger on any posts with this problem. Can you suggest any possible causes? Link to the gallery is http://www.bullseyephotos.com/gallery-2006/index.php and it has a few photos in it to test everything out before going into production.

Cheers and thanks for all you help,

Billy
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Gizmo on March 03, 2006, 01:05:11 am
Hi All,

I compared the database for this new gallery to last years gallery and found that several database cpg_config VALUES were missisg.  :-\ I got the hint from the above post (http://forum.coppermine-gallery.net/index.php?topic=19491.msg108523#msg108523) so I added them manually using phpMyadmin. While this may not be for the "faint of heart", I wasn't concerned since I was working on a new gallery with only test pictures but doing this on an already used gallery may cause one to sweat.

The reason I wanted to use this PayPal method over the latest one (http://forum.coppermine-gallery.net/index.php?topic=26454.0) by Casper is that I wanted to have my pricing choices right under the picture to prevent users from having to scroll to select a photo. I'm in the processing of creating a theme to be more "scrolling" friendly on monitors with resolutions of 1024x768 and hopefully 800x600 while still readable on my laptop with 1400x1050.

Cheers,

Billy
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Richy.nl on March 03, 2006, 01:41:09 pm
How about a photo ordering system like this Pay P system WITHOUT using Pay Pall? I want to have a system wich sends the orderform straight to the photographer...... Lot's of people don't want to pay by creditcard / paypall because of fraude......
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on March 04, 2006, 11:18:41 am
if you need an entirely different mod, then create it or hire someone to code it for you. However, this thread is dedicated to the paypal hack, so you mustn't clutter it with irrelevant requests.
Title: Re: add a Paypal shopping basket to your gallery.
Post by: pcp20us on March 26, 2006, 11:35:38 am
Hello All

I have been reading the paypal hack . I have it working on my site, though i notice that it does not work if you do a batch add. I am doing the add from publish to the web from with in XP.  how are poele getting this to work as if your uploading many photos you dont want to do it one at a time?

Thanks to all the emails espically casper the friendly ghost !!


Pete
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Terec on April 01, 2006, 09:52:46 am
Hello All

I have been reading the paypal hack . I have it working on my site, though i notice that it does not work if you do a batch add. I am doing the add from publish to the web from with in XP.  how are poele getting this to work as if your uploading many photos you dont want to do it one at a time?

Thanks to all the emails espically casper the friendly ghost !!


Pete

Ditto to Petes comment.  I have been known to add almost 900 files to a site that I would like to now sell through the gallery and being able to set the pricing in the batch add would be a very welcome tool,  is there another hack that is capable of this?

Thanks to everyone who helps put coppermine out for people like me who dont know jack about computer coding, but loves to share/sell photos

Terec
TLMotorsports Photography
Title: Re: add a Paypal shopping basket to your gallery.
Post by: jeep11 on April 15, 2006, 09:18:17 pm
Perfect! Got it working straiight out of the box, just two stupid "newbie" questions, firstly which file do I modify to change the  "Buy with confidence" text and how do I remove the blank "@" options in the drop down price catergory as I only sell two image sizes and don't need the rest? Thanks for an excellent mod though hope these questions are not too dumb!  :'(
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Joachim Müller on May 10, 2006, 08:18:32 am
split unrelated reply that deals with integration for fotokasten.de and merged it with the corresponding thread (http://forum.coppermine-gallery.net/index.php?topic=10147.msg144977#msg144977).
Title: Re: add a Paypal shopping basket to your gallery.
Post by: eyeliner on May 11, 2006, 10:37:30 am
Hello, i've installed succesfully coppermine 1.3 with the paypal mod.
Now i have several albums with several pics and every pic can be bought in three different resolution formats.
So i have the three options in the combobox under the pic (in the preview window) with the paypal button "add to basket".
And also che checkout works properly.
All right.

here comes the problem:
I need to send to paypal (cause of a IPN workaround) also a variable (item_number) that contains the picture id (the one called pid in the database) concatenated with the choosen resolution.
How can i do that?

for example:
the pic cat.jpg has pid=100 in the db and the user wants to buy the resolution number 2.
so i must send to paypal something like item_number=100_2; or item_number=100-2; or item_number=100b; it is the same in fact  :)


i suppose i should add some code in theme.php in the block of code tagged <!--  view basket button  --> but i don't know php so much...
Nobody can please light me??

Many thanks and regards
Title: Re: add a Paypal shopping basket to your gallery.
Post by: eyeliner on May 16, 2006, 10:23:52 am
nobody can help me?
At least an hint :) on how to pass those parameter to the page...then i'll try to figure it out.
thanks, regards
Title: Re: add a Paypal shopping basket to your gallery.
Post by: Puffinstuff on July 20, 2006, 01:47:43 pm
Just upgrade to 1.4.8 and added Paypal hack.  All went well but ...

I now have "Price structure, use 1,2,3,4 or 5:" displayed in my File Info. (Which I would prefer if it was not there)

http://www.lumieres.com.au/gallery/displayimage.php?album=101&pos=16

I have searched everywhere within the site and cannot find this to comment it out.

Where is this so can I comment it out?

regards and thanks in adcance...


[Edit GauGau]Ignore this posting (see http://forum.coppermine-gallery.net/index.php?topic=34059.0 for the reason why)[/edit]
Title: Re: add a Paypal shopping basket to your gallery.
Post by: BikiniPhotoBank on September 30, 2006, 06:43:37 am
Ok i have installed the paypal mod 1.4.9 using cpg149 using eyeball
Everything looks great except that the dropdown menu says "please email for information on this product" For some reason even though i have added the items in the shopping cart admin section its not showing the prices.
What did i overlook?
Title: Re: add a Paypal shopping basket to your gallery.
Post by: netfalls on March 23, 2009, 12:59:39 pm
Hi all,

How can I get more than 10 options?

Thanks