Hi There,
If you have an issue with pricing so that it only shows the default price you set, even if your button is setup with a price like:
[[PayPal?amount=5.99&name=Gold Watch]]
Then you either need to do one of the following:
(Red is the section edited)1)
Change: [[PayPal?amount=5.99&name=Gold Watch]]
To: [[PayPal?
price=5.99&name=Gold Watch]]
OR
2)
Change:
// Amount of the item, if non passed to the snippet, default value used.
if (empty($price)) $PAYPAL_AMOUNT = $PAYPAL_AMOUNT;
Else $PAYPAL_AMOUNT = $price;
To:
// Amount of the item, if non passed to the snippet, default value used.
if (empty($
amount)) $PAYPAL_AMOUNT = $PAYPAL_AMOUNT;
Else $PAYPAL_AMOUNT =
$amount;
PLEASE NOTE:It's probably easier to edit the snippet, if your page is filled with different:
[[PayPal?amount=5.99&name=Gold Watch]] because currently, the snippet looks for 'price' not 'amount' like it is in that line.
However, if you only have one:
[[PayPal?amount=5.99&name=Gold Watch]]
Then just change the line, not the snippet.
Just to avoid any confusion, here it is re-done:
// -----------------------
// Snippet: PayPal
// -----------------------
// Version: 0.1a
// Date: 21 June 2005
// Written by Rob Freemantle (Robsta), www.inspired-solutions.net
//
// This snippet was designed to make it easy to use PayPal buttons in Etomite.
//
// IMPORTANT NOTE: This Snippit has not been tested with the requirements of a real transaction.
//
// Display 'Buy Now' button... Â
// Usage  [[PayPal?amount=5.99&name=Gold Watch]]
//
// Display the shopping cart... Â
// Usage  [[PayPal?cart=1]]
//
// To also include specific text which appears over the image,
// add  '&text=New text'
//
// Display 'Buy Now' button... Â
// Usage  [[PayPal?amount=5.99&name=Gold Watch&text=Click here to buy a gold plated watch]]
//
// Display the shopping cart... Â
// Usage  [[PayPal?cart=1&text=Click here for the shopping cart]]
//********************************************************************************
**********
//********************************************************************************
**********
// Default Settings - General
//********************************************************************************
**********
//********************************************************************************
**********
// Email account to pay the money to.
$PAYPAL_BUSINESS= "name@domain.co.uk";
$PAYPAL_IMAGE = "https://www.paypal.com/en_GB/i/btn/x-click-but22.gif"; Â Â Â Â Â //Default payment button image
$PAYPAL_IMAGE_ALT = "Make payments with PayPal - its fast, free and secure!"; Â Â //Default payment button mouseover text
$PAYPAL_ADD = "1"; Â Â Â Â Â Â Â Â Â Â Â //default number of items
$PAYPAL_ITEM_NAME = "Unnamed Item"; Â Â //default item name, configurable per Snippet call
$PAYPAL_AMOUNT = "1"; Â Â Â Â Â Â Â Â Â //Default item price, configurable per Snippet call
$PAYPAL_CMD = "_cart";
$PAYPAL_PAGE_STYLE = "Primary";
//include the address to the root of Etomite,
// excluding the last forward slash. Basically
// to the location of the index.php.
// For example: "www.domain.co.uk/etomite"
// where index.php can be found http://www.domain.co.uketomite/index.php
$YOUR_URL = "www.domain.co.uk"; Â Â Â
// On completion of the purchase, customers are returned to this document ID.
$PAYPAL_RETURN_PAGE_ID = "0"; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
$PAYPAL_NO_NOTE = "1";
$PAYPAL_CURRENCY_CODE = "GBR"; Â Â Â // currency setting
$PAYPAL_LC = "GB"; Â Â Â Â Â Â Â Â Â // currency setting
// Default view cart details
$PAYPAL_CART_IMAGE = "https://www.paypal.com/en_GB/i/btn/view_cart_02.gif"; Â Â Â Â Â Â //Default payment cart image
$PAYPAL_CART_IMAGE_ALT = "Make payments with PayPal - its fast, free and secure!"; Â Â // Default payment cart mouseover text
//********************************************************************************
**********
//********************************************************************************
**********
// The Snippet code
//********************************************************************************
**********
//********************************************************************************
**********
// Amount of the item, if non passed to the snippet, default value used.
if (empty($amount)) $PAYPAL_AMOUNT = $PAYPAL_AMOUNT;
Else $PAYPAL_AMOUNT = $amount;
// Name of the item to appear in the shopping cart, if non passed to the snippet, default value used.
if (empty($name)) $PAYPAL_ITEM_NAME = $PAYPAL_ITEM_NAME;
Else $PAYPAL_ITEM_NAME = $name;
// Shows buy now form or entire shopping cart.
// If the cart = empty (not set in the call), the 'buy now' button is shown.
// Â Â Â Else if cart=anything, the cart is opened.
if(!$cart)
{
// Text appearing over the buy now button, if non passed to the snippet, default value used.
if (empty($text)) $PAYPAL_IMAGE_ALT = $PAYPAL_IMAGE_ALT;
Else $PAYPAL_IMAGE_ALT = $text;
$Output .= "<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>";
$Output .= "<input type='image' src='".$PAYPAL_IMAGE."' border='0' name='submit' alt='".$PAYPAL_IMAGE_ALT."'>";
$Output .= "<input type='hidden' name='add' value='".$PAYPAL_ADD."'>";
$Output .= "<input type='hidden' name='cmd' value='".$PAYPAL_CMD."'>";
$Output .= "<input type='hidden' name='business' value='".$PAYPAL_BUSINESS."'>";
$Output .= "<input type='hidden' name='item_name' value='".$PAYPAL_ITEM_NAME."'>";
$Output .= "<input type='hidden' name='amount' value='".$PAYPAL_AMOUNT."'>";
$Output .= "<input type='hidden' name='page_style' value='".$PAYPAL_PAGE_STYLE."'>";
$Output .= "<input type='hidden' name='return' value='http://".$YOUR_URL."/index.php?id=".$PAYPAL_RETURN_PAGE_ID."'>";
$Output .= "<input type='hidden' name='no_note' value='".$PAYPAL_NO_NOTE."'>";
$Output .= "<input type='hidden' name='currency_code' value='".$PAYPAL_CURRENCY_CODE."'>";
$Output .= "<input type='hidden' name='lc' value='".$PAYPAL_LC."'>";
$Output .= "</form>";
}
else
{
// Text appearing over the buy now button, if non passed to the snippet, default value used.
if (empty($text)) $PAYPAL_CART_IMAGE_ALT = $PAYPAL_CART_IMAGE_ALT;
Else $PAYPAL_CART_IMAGE_ALT = $text;
$Output .= "<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>";
$Output .= "<input type='image' src='".$PAYPAL_CART_IMAGE."' border='0' name='submit' alt='".$PAYPAL_CART_IMAGE_ALT."'>";
$Output .= "<input type='hidden' name='cmd' value='".$PAYPAL_CMD."'>";
$Output .= "<input type='hidden' name='business' value='".$PAYPAL_BUSINESS."'>";
$Output .= "<input type='hidden' name='display' value='1'>";
$Output .= "<input type='hidden' name='page_style' value='".$PAYPAL_PAGE_STYLE."'>";
$Output .= "</form>";
}
return $Output;^^ Just put this into a snippet, named PayPal (case sensative) If you name it anything else, you will need to change the: [[PayPal?]]
To:
[[Whatever you called it?function]]
So, if you called it Shopping
You need to use:
Show Cart: [[Shopping?cart=1]]
Add To Basket: [[Shopping?amount=10.00&name=My Item Costing £10]]
etc...
-------------------------------------------------------------------------------------
Apart from that little glitch, excellent code Robsta - Thank you

(Apologise for the LONG post...)