Introduction
PHPCart is the ideal shopping cart solution for small merchants who wish to bring their
business online. PHPCart is very easy to install and operate. Furthermore,
PHPCart does not
require a database, thus reducing the fuss and complexity normally associated with other
shopping cart solutions. PHPCart supports many languages and you can customize the look-and-feel
of every page. PHPCart is written in PHP and if you are a developer you can easily customize it to perform specialized tasks.
Installation
Create a directory in your web-area where you wish to keep PHPCart (typically phpcart). Upload (in BINARY mode) the distribution
package and unpack it with the following commands (via telnet):
gunzip phpCart_vx.x.zip (where x.x is the version number)
If you do not have telnet access to your server (e.g. if you are using Windows NT/2000), you must
unpack the distribution with WinZip or similar program, and then upload each file by FTP (in ASCII mode).
If you are using PHPCart on Linux, make sure the script has read and write access to the sessions directory.
You can do this by typing chmod 777 sessions via telnet.
Alternatively, use your FTP program to change the permissions.
You must also change access permissions on folder orders 777 if you wish to keep a copy of each order in a text file online.
You must also set write access to the following files in the admin folder:
admin_1.php
configuration_1.php
coupon_1.php
payment_1.php
header.inc.php
footer.inc.php
Configuration
Send your browser to yourdomain.com/phpcart-location/admin/ and login with the default username of admin and default password of password. Make sure you change your password and then move on to edit the settings required to run
PHPCart.
The Configuration settings contain configurable variables you must change before using
PHPCart.
All variables are self-explanatory. They contain information such as company name, your email address, what
colors to use and other information used by PHPCart.
You must also setup at least one payment method in the Payment Configuration section before running the cart.
Preparing your shop
This is the real easy part. As PHPCart does not use a database of any kind to store information
about the products in your shop, all information about each product (description, price etc.)
must be included in the link to PHPCart.
Create your web-pages as usual, or use your existing. For each product on your web-pages, create a link
that surrounds the image or title of the project, alternatively an Order! button. Whatever you
have will work. In the link, include the web-path to phpcart.php. In addition, include the following variables:
- action - always 'add'
required
- id - product ID
required
- descr - product description (short sentence; see below)
required
- price - product price (must be numerical)
required
- quantity - quantity of product to put in basket
required
- option1 - This allows you to pass an option such as product size or
color.
optional
- option2 - Same as above.
optional
- option3 - Same as above. optional
- postage - Amount of postage to add to this item if any
optional
As an example, consider the following link:
/phpcart/phpcart.php?action=add&id=1001&descr=Nike&20T-Shirt&option1=Green&option2=Small&price=19&quantity=1&postage=1.59
In this case, the variables above have been assigned the following values:
- action - add
- id - 1001
- descr - Nike T-Shirt
- option1 - Green
- option2 - Small
- price - 19
- quantity - 1
- postage - 1.59
Notice how each variable is separated by the ampersand (&).
Include links you create in <A HREF>. When your customers click on the link,
the product will be added to their shopping cart automatically by PHPCart.
Try not to use other characters in the description than letters and numbers.
Some browsers may not pass them on correctly to PHPCart.
In particular, never use spaces! Netscape will not capture spaces in URLs and
will drop all information from the link following the first space it encounters.
You can emulate spaces with the string %20, as in the example above.
This will work with Netscape, as well as Microsoft Explorer. Always test your links
on different machines with different browsers to make sure they all work correctly.
We now have an automatic product code generator which you may use free of
charge. Point your browser to http://www.phpcart.net/autogen/
Localization
PHPCart is by default in English. In addition, we now support Italian, French
and Spanish with thanks to our members.
You can also translate the included language file to your own language if there
is no translation. To do so, copy the file english.php in the /localization directory.
Give the copied a file the name of your language. Edit the file and replace every string
within double-quotes to the equivalents in your language. Save the file in the
/localization directory. To active your language, edit the $language
variable in the configuration file (see CONFIGURE above) to
match the name of the new language file (without the .php suffix). For example,
if your language is Danish you may want it to look something like this:
// Language (english, norsk)
$language = "danish";
Variable Postage
It is now possible to add variable postage fees when adding an item to your shopping basket. Simply follow the insructions below to add this extra variable when creating your 'Add to Basket' links.
As well as the variables mentioned above, when adding your items to your site
you can opt to enter a postage amount along with the other details. You can
enter any number, simply add the following variable to your 'Add to Cart' links:
postage=2.99
Alternatively you can still add postage per order if you wish, simply add the amount you would like to charge as postage inside the Admin Panel and it will be added at the checkout. You can also opt to add a set postage fee per order as well as a per item fee by adding both.
Coupon System
PHPCart now supports coupons. A coupon can give a fixed amount discount or a percentage of the subtotal discount. Coupons can also be set to expire.
If a coupon gives a fixed amount discount and the subtotal is less than the discount then the subtotal becomes the discount amount. Example: Discount is $10 but the subtotal is $9. The customer only gets a $9 discount. The extra $1 will not go towards shipping or postage or tax.
Add coupons in the admin section. You can not edit a coupon but you can easily delete and recreate a coupon if you make a mistake. Remember the percentage discount must be in whole numbers such as 35 (for 35%). Don't enter .35.
Making PHPCart work on Windows NT/2000
PHPCart uses the native PHP mail() function for sending out emails when a
customer submits his order. You need to do some minor tweaking to make PHP
send emails on NT/2000 platforms.
- Install Microsoft Exchange Server on your server. Create an Internet
Connection in the Exchange server
giving the name or IP address, on which your ISP is running an SMTP
server. Say we give a name to the exchange server MYEXCH. You can contact
your ISP and ask him to give you the gateway or the IP address on which
your ISP is running the SMTP server.
- Modify your php.ini file section of the [mail] to include SMTP =
MYEXCH. Put a valid e-mail id.
Then the mail() function should be able to send mails to the internet.
If you do not have Exchange Server software you can use Smart Server and
Internet Anywhere Mail Server to connect to the gateway of your ISPs SMTP
server to send mails.
Frequently Asked Questions
Copyright notice
Please note that all files in this distribution are copyright the Author.
You may not re-distribute any portion of the distribution without the expressed permission of the author.
License
You have purchased a copy of PHPCart. Depending of your license you may not be able to use this
cart on as many subfolder, and domain names as you like.
Help and support is available in our Forum available via our website: PHPCart Web Site