File Submitter: Cris D.
File Submitted: 16 Sep 2007
File Updated: 17 Nov 2007
File Category: 3rd Party Integration
BY: Cris D for Etomite CMS
USE: Creates multiple item shopping page that allows users to purchase items through paypal
LIMITATIONS: Due to the complex and changing field of on-line shopping, this snippet is designed as a base to start from and must be cusomised for individual use. Individual circumstances change dramatically, therefore only assistance with the snippet code logic will be offered in the etomite forums.
###### For paypal assistance, please see paypal.com. ######
- Copy and paste this code into your snippet library.
- Change the items requiring configuration. Save it as etoBasket.
- Call the snippet in a page [!etoBasket!] and start entering your items for sale.
- This snippet assumes that you have a current paypal account to receive payments (d'oh).
SECURITY and LOGGING IN: If you will need to have the snippet authenticate_visitor on your site to log in and enter data or place a snippet call ?permission=1 to temporarily override the authentication temporarily (doing this is a security risk and is not the recommended method of use!).
CREDITS: robsta for the initial paypal snippet, Ralph and Dean for Etomite!
See a simple 3 item sample (not an active shop) page here (obviously you can't see the managers page so here's a screenshot.
You can set the following item details in the manager:
page to show on (for categories),
active? (to temporarily hide).
The following paypal fields are configurable:
default: how many to add?
Paypal page style?
Return page on success of payment?
note? no note? (allows customers to leave a message or not).
currency Icon="$" ?
Other tweaks available...
You can also control how it presents if you (optionally) copy and paste the "InternalTemplate" and save it as a new chunk, set the $paypalChunk="yourChunkHere"; and your template will be used to display the data.
Additionally, I have built in a delete confirmation message that does NOT use java so IE with pop-ups blocked still works.
Additional data can easily be added at line 302 where the $PAYPAL_INFO array is built inside the snippet before merging with the template. This allows users to add any other variables they like to the output.
You can also use the div.pp_odd and div.pp_even classes to display alternating records differently if desired.
Updated 27/10/07 Ver 1.1
- Changed the form action from '_blank' to 'paypal' to stop numerous carts from opening up.
- Added a "view cart" link above the first item and below the last item on the page. This link can also be configured to use a button image instead of text.
Fixed some minor validation issues. This snippet now outputs valid code.
Click here to download this file