Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: 1 ... 6 7 8 9 [10] 11 12 13 14 ... 20   Go Down

Author Topic: add a Paypal shopping basket to your gallery.  (Read 316449 times)

0 Members and 1 Guest are viewing this topic.

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: add a Paypal shopping basket to your gallery.
« Reply #180 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;
Logged
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

gab696

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: add a Paypal shopping basket to your gallery.
« Reply #181 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.

Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: add a Paypal shopping basket to your gallery.
« Reply #182 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">
Logged
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

dondo521

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Album Title To Show up in The PayPal Cart...
« Reply #183 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
Logged

fareforce

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 66
  • Who are you calling a weasel?
    • Alaska Studio
Re: add a Paypal shopping basket to your gallery.
« Reply #184 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..
Logged
~fareforce
Anchorage, AK
Home of the frozen weasel
http://www.alaskastudio.com

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Album Title To Show up in The PayPal Cart...
« Reply #185 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'],
        );
Logged
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

equi

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: add a Paypal shopping basket to your gallery.
« Reply #186 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
    }
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: add a Paypal shopping basket to your gallery.
« Reply #187 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.
« Last Edit: July 01, 2005, 12:15:34 am by Casper »
Logged
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

dondo521

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: add a Paypal shopping basket to your gallery.
« Reply #188 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
Logged

dobermin

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: add a Paypal shopping basket to your gallery.
« Reply #189 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

 
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: add a Paypal shopping basket to your gallery.
« Reply #190 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.
Logged
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

dobermin

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: add a Paypal shopping basket to your gallery.
« Reply #191 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
Logged

trap

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: add a Paypal shopping basket to your gallery.
« Reply #192 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  

Logged

alanuk

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: add a Paypal shopping basket to your gallery.
« Reply #193 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
Logged

trap

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: add a Paypal shopping basket to your gallery.
« Reply #194 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
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: add a Paypal shopping basket to your gallery.
« Reply #195 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.
Logged
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

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: add a Paypal shopping basket to your gallery.
« Reply #196 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.
Logged
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

alanuk

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: add a Paypal shopping basket to your gallery.
« Reply #197 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
Logged

LiquidLife

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: add a Paypal shopping basket to your gallery.
« Reply #198 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~
« Last Edit: February 09, 2005, 10:08:45 pm by TranzNDance »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: add a Paypal shopping basket to your gallery.
« Reply #199 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.
Logged
Pages: 1 ... 6 7 8 9 [10] 11 12 13 14 ... 20   Go Up
 

Page created in 0.034 seconds with 19 queries.