News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

add a Paypal shopping basket to your gallery.

Started by Casper, July 04, 2004, 07:02:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LiquidLife

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.

Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Roshlin

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.

skypix

#203
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.


Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

skypix

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.



romans815

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.

Casper

@ skypix,

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

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;

<input type="hidden" name="cn" value="Additional Info">

Put it in a line immediately before this line;

<input type="hidden" name="currency_code"...


To remove the paper selection just remove this code;

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;
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Roshlin

Hi Casper,

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

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


Casper

Hi Roshlin,

Open displayimage.php, and find;

$pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb');

And add in new line after;

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


Now find;

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


Add after;

'{PATH}' => $path_to_pic,

Now open your theme.php, and find;

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

Change it to;

<input type="hidden" name="basedes" value="{TITLE}, {PATH} " />
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

skypix

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.




Roshlin

#211
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


Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Flipper01

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?

Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

mgraf

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.

<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? 
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....

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

Casper

Yes, looks about right to me, but I havn't had time to test it.

Make sure you back up your files before testing.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

mgraf

#217
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:

QuotePlease enter an amount greater than zero.

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

<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

l-nes

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.

netfalls

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/
In my view you cannot claim to have seen something until you have photographed it