Jump to content


Photo
Cris D.

  • : Sep 16 2007 12:02 PM
  • : Nov 16 2007 05:19 PM
  • : 14.97K
  • : 3711
  • : 592

  • 26 Oct 2007 etoBasket for paypal
  • 16 Sep 2007 etoBasket for paypal

etoBasket for paypal





SNIPPET: etoBasketV1.1
DATE: 16/9/07
Updated:27/10/07
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. ######

INSTALLATION INSTRUCTIONS:
  • 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.

THE DETAILS:
You can set the following item details in the manager:
Title,
Description,
Price,
picture folder/,
picture filename,
page to show on (for categories),
active? (to temporarily hide).

The following paypal fields are configurable:
your email?
button image?
button alt=""?
default: how many to add?
_CMD:_cart
Paypal page style?
Return page on success of payment?
note? no note? (allows customers to leave a message or not).
Currency?
Location code?
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.

CHANGELOG:
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.
Updated 2007/11/17
Fixed some minor validation issues.  This snippet now outputs valid code.








0 members, 0 guests, 0 anonymous users