PayPal Modification for Coppermine
I receive numerous requests from other Coppermine users who want to know how to incorporate PayPal into Coppermine. Below I provide everything you need to incorporate PayPal into your installation of Coppermine exactly as I have incorporated it into mine.Please support continued development of this feature through a donation of US$15. I provide this feature at no cost. I rely on donations from those who find it useful. Consider how this will provide revenue for your business and help support its maintenance and development through a modest donation.
DISCLAIMER: This is provided as is, free of charge, with no warranty or guarantee. Use this freely, but use it at your own risk.
My PayPal changes add two significant features to Coppermine:
The following link downloads a ZIP file containing my modified Coppermine files for the version of Coppermine I have running on my website. It may or may not be the current version of Coppermine.
- Support for a PayPal shopping cart. The shopping cart is simple. Every image that is available as a print is available with exactly the same options. My changes do not support offering different options for different images.
- Indication per image whether the shopping cart is offered to the customer. The was implemented so that I can include certain images in my gallery that demonstrate my skills and range of subject matter, but that I cannot sell as prints due to model or property release restrictions.
- PayPal for Coppermine V1.4.24 (posted 06 Jun 2009)
Before you start, make a backup copy of the following files. Then drop my copy of these files in the place I indicate in your Coppermine installation. In the following bullets, the term "<your coppermine>" refers to the top level Coppermine directory on your web site.
- <your coppermine>/editpics.php
- <your coppermine>/editOnePic.php
- <your coppermine>/include/themes.inc.php
- <your coppermine>/lang/english.php
The following are additional files in the ZIP file. Install them where indicated:
Customize the following files for the options and prices you offer, and for the location of paypal.js in your web site:
- <your website>/scripts/paypal.js - javascript that submits items to your PayPal account
- <your website>/images/cart_add.gif - button used in themes.inc.php
- <your website>/images/cart_view.gif - button used in themes.inc.php
- <your website>/images/paypal.psd - source Adobe Photoshop ® file for customizing the shopping cart buttons for your site
Next you must make the following MySQL database change to the pictures table:
- paypal.js - match the options and prices, including the order, to themes.inc.php
- themes.inc.php (Coppermine 1.4.24) - starting at line 2228
- match the options and prices, including the order, to paypal.js
- set the correct location of paypal.js in your site
- set the correct location of cart_add.gif and cart_view.gif in your site
- set the paypal account name to your paypal account
You also need to do a mass update to that column for all the pictures already in your database.
- "pictures" table - create a column of type "tinyint" called "forsale" and give it a default value (1 = print is for sale, 0 = print is not for sale)
- set "forsale" to 1 to show your paypal shopping cart underneath.
- set "forsale" to 0 to not show your paypal shopping cart underneath.
And finally, you must make sure the 'title' field is set for every picture. I use the Coppermine Admin screen to set the 'title' field to the filename as my filenames are also my image IDs in my image catalog database. This modification uses the title field contents to identify the specific image added to the PayPal shopping cart.
Those are all the modifications!
REMINDER: Any time you change your product offerings, you must change both the paypal.js and themes.inc.php files.
Now log into your Coppermine gallery in admin mode and click the "Edit Files" button next to each of your albums. On that screen, you will see a new checkbox under every image description called "Show shopping cart ". You can check or uncheck that box to enable or disable the shopping cart for that image. The same "Show shopping cart" checkbox is displayed when you click the "Edit Description" button while viewing an image in admin mode.
I hope this is helpful and not too complicated. Please write me with recommendations for enhancing or correcting these directions.
Feel free to e-mail me if you have problems. Please do not ask for enhancements unless you are making a donation. Remember this is free and provided as is.