(Líder Mundial con más de 100.000 web sites alojados)
Shopping Cart script
Descripcion
El programa Carrito de la Compra permite a los visitantes de su tienda virtual recoger productos en su carrito virtual. Puede
comprobar el contenido de su carrito en cualquier momento y añadir o quitar articulo a su gusto. El programa calcula
automáticamente el subtotal, impuestos aplicables, costes de envio y Total. Cuando un visitante decide "pasar por caja", la
informacion del comprador, incluido su nombre, dirección e instrucciones de pago son enviadas via e-mail a su departamento de
ventas (o quien usted quiera) y un recibo al comprador.
Caracteristicas
Envia los pedidos a una o mas direcciones
Envia un recibo al comprador
Se acomoda a sus tipos de envio
Permite al propietario predefinir los tipos de impuestos aplicables.
Sigue la pista de las compras incluso cuando el visitante da el boton "atras" del navegador.
Sigue la pista de los visitantes asignando un numero identificativo del comprador (SID) (no utiliza cookies)
Qué es lo que no hace este programa
No puede seguir al visitante si este abandona el website
No calcula costes de envio exactos. Puede calcular un precio base mas un cargo adicional por cada articulo, basado en
hasta 4 diferentes formas de envio que puede crear. Sin embargo, no puede calcular costes de envio basados en el peso,
tamaño o zona.
No efectua pagos on-line. Puede ser integrado con un programa de pago on-line como Cybercash o First Virtual, pero estos
no estan incluidos en el script del Carrito de la Compra.
No transmite de forma segura datos de tarjestas de credito o similares. Puede utilizar nuestro servidor de seguridad SSL
para realizar estas operaciones. El correo enviado desde el script a la persona especificada no esta encriptado.
Instalacion
El Carrito de la Compra es facil de instalar. No necesita saber PERL o cualquier otro lenguaje de programación y no necesita ser un
experto webmaster. Siga los pasos que vienen a continuación:
1.Instalar el software de Carrito de la Compra
2.Editar el fichero de configuracion
3.Crear su lista de productos
4.Modificar sus páginas HTML para incluir las funciones de Carrito de la Compra
1. Instalar el sofware de Carrito de la Compra
Para instalar el software en su web:
1. Acceda al URL http://www.su dominio/cgi-bin/secure/shopinst
2. Presione el boton "SI" para instalar los ficheros
PRECAUCION: esto sobreescribira cualquiere version preexistente de Carrito de la Compra.
La instalacion creará un subdirectorio dentro de su espacio llamado /shop que contiene diversos ficheros HTML
utilizados para una demostracion. Tambien es creado el directorio /lists y /temp. Un fichero de configuración llamado
shop.cfg sera colocado en su directorio /cgi-local. Después de la instalacion aparecerá una referencia a la
demostracion recientemente instalada dentro de su espacio.
Ficheros demo dentro de /shop/
Utilice estos ficheros como ejemplo.
Puede borrarlos cuando cree
sus propias páginas.
--------------------------------
cdrom.html
done.html
email.html
harddrives.html
list.html
modem.html
shop.html
tapes.html
product_list.txt
/picts/ (images used in demo)
2. Editar fichero de Configuración
2a. Bájese el fichero de configuración
Utilice el programa FTP para bajarse el recien instalado fichero de configuración (shop.cfg) a su ordenador. El fichero
está localizado en su directorio /cgi-local.
*** Asegúrese de que transfiere el fichero shop.cfg en modo ASCII (no binario).
Despues de que haya bajado el fichero de configuración lo puede editar con cualquier editor de textos como Notepad,
WordPad o TeachText. Recuerde guardar el fichero como "solo texto" y asegúrese de mantener el mismo nombre de
fichero.
2b. Especifique a qué dirección(es) de correo quiere que se envien los pedidos.
Como se ha mencionado, el script de Carrito de la Compra puede enviar los pedidos a una o dos direcciones de
correo. Estas direcciones están especificadas dentro del fichero shop.cfg en una sección llamada '# mailing info'
como se muestra aqui:
# mailing info
$admin = ''; # a quien enviar el pedido
$admin1 = ''; # a quien enviar el pedido
Introduzca la direcciuon de correo electrónico a quien desea que se envien los pedidos entre las comillas simples
después de la variable $admin como en este ejemplo:
# mailing info
$admin = 'johndoe@john.com'; # a quien enviar el pedido
$admin1 = 'janedoe@jane.com'; # a quien enviar el pedido
*** Para especificar una sola dirección de correo simplemente deje la segunda variable vacía.
*** IMPORTANTE! DEBE dejar las comillas entre la dirección de correo.
2c. Specify the Sales Tax Rate for your State.
The Shopping Cart script will automatically calculate the Sales Tax for an order provided you specify the two letter
postal code and tax rate for your state. If the two letter postal code in the billing address of a user matches the postal
code you specify, then the appropriate sales tax will be added to the order according to the tax rate you specify. The
sales tax is specified within the shop.cfg file in a section titled '# current tax rate and states' as shown below:
# current tax rate and states
$tax_state = "FL"; # State in uppercase
$tax_state2 = "fl"; # State in lowercase
$tax_rate = ".06"; # 6 %
Change the "FL" and "fl" in the $tax_state variables to the two letter postal code for your state. Change the ".06" in the
$tax_rate variable to the current sales tax rate in your state. For example, if your sales tax is 5.5%, you would edit the
$tax_rate variable to read: $tax_rate=".055";
2d. Especifique los gastos de envio que desea utilizar.
El Carrito de la Compra puede acomodar hasta cuatro tipos diferentes de costes de envio que usted especifica. Cada
uno de estos cargos es calculado utilizando una tarifa base más un coste adicional por cada producto solicitado. La
seccion de envios esta localizada en la parte final de del fichero shop.cfg como se muestra debajo:
# Introduzca aqui los costes de envio
#
# especifique "" para desactivar envio
# especifique "" para desactivar un tipo de envio
las dos primeras líneas determinan el primer grupo de costes de envio, las dos segundas el segundo grupo de costes
de envio, etc. Tan solo necesitra cambiar las cantidades dentro de las comillas para cada par de tarifa base y coste
de envio. Utilice el siguiente ejemplo como guia para configurar los costes de envio.
The last example is a little tricky. The first item would be charged $11.00 plus 1 x $4.00 = $15.00. Each additional
item would add an additional $4.00 to the shipping charge.
Note: this program cannot calculate shipping charges based on weight, type of item, zone, country, or shipping tables.
2e. Upload the Configuration File
After you have finished making the necessary changes to your configuration file and have saved it as a plain text file,
use your FTP program to upload this file (shop.cfg) back up to your /cgi-local directory.
*** Be sure you keep the file name shop.cfg when you save your changes.
*** Be sure to upload the shop.cfg file in ASCII transfer mode (not binary mode).
3. Create your product list
The product list contains order information about each item you wish to make available through the Shopping Cart
program. The Shopping Cart Generator creates a sample product list file named product_list.txt which is used in
conjunction with the demo. You may modify this existing product list file (found within the /shop directory) or create
your own, but make sure you keep the name product_list.txt. You can use a plain text editor (Notepad, WordPad,
Teachtext, etc.) to create or modify this file (be sure to save as plain text).
The product list contains one line of information for each product you sell. Each line contains 4 specific sections of
information that the Shopping Cart program needs to create the order. A pipe symbol " | " (hold shift and hit the key
below the Backspace/Delete key) is used to separate each of these 4 sections of information. Therefore, make sure
you do not use this symbol in any of your descriptions; use it only to separate the 4 categories.
Item ID Product Description
| |
| Product Number | Price
| | | |
Item ID
This is a unique ID number used to reference each item in your list. It is usually numbered in ascending order
beginning with the number 1, as in the example. You will use this ID number to reference your products in your web
pages.
Product Number
Your internal item or product number associated with the item. This product number will be listed on the order form for
each product the customer orders and is used for your reference.
Product Description
This is the description of the product that you want printed on the order form. This is not the description that you put
on your web pages to describe your products. This description only appears on the order form, between the product
number and the price, for each product the customer orders.
Price
The price of a line item to two decimal places (e.g. 13.00 or 7.98). You must include the cents; if the product costs an
even dollar amount include .00 to the end of the price for the cents. This price only appears on the order form and is
used to calculate the total of the order. If you change your prices, make sure you update your prices in your web
pages as well as in this product list file.
*** Be sure to download and upload the product list file in ASCII transfer mode only.
*** If you choose to rename the product list file you MUST also do so within the config file.
4. Modify Your Web Pages to Include the Shopping Cart Features
One of the nice features of the Shopping Cart program is that you can develop the structure and look of your web pages any way
that you want. You are only limited by your imagination. You can list all your products on one page, or you can create a dozen
pages for each product. It's all up to you. There are just a few additional steps needed to add the Shopping Cart functionality to your
web site.
*** All of your pages must reside within the /shop/ directory.
4a. Create an Entry Page.
A shopping cart program can only work if it can keep track of a particular customer as that customer travels through a
site. The Shopping Cart program uses a computer generated Shopper ID (SID), to keep track of each customer that
visits your web site and what products that customer has added to his or her shopping cart. You will need to create an
Entry Page that will give the Shopping Cart script a chance to generate a unique Shopper ID for each customer before
the customers reach any pages from which they might add or view products in their shopping cart. Customers must go
to this Entry Page before going to any pages that implement the shopping cart functionality (i.e. any of your product
pages).
Your Entry Page can look however you want it to look, but it must contain a special link that will transport the
customer into your site while at the same time telling the Shopping Cart script to generate a unique Shopper ID (SID)
for the customer. This link will look similar to the following:
This link tells the Shopping Cart program (shop.pl) to transport the customer to "list.html", but first generate a new
unique Shopper ID for the customer and hide it within the hyperlinks of the "list.html" page. You can refer the customer
to any page that you want; you do not need to use "list.html".
Many people create Entry Pages that tell visitors to download the latest version of Netscape or Explorer, or that give
visitors the choice of a high graphic version or text only version of the site, or that just present visitors with an
introductory splash screen that introduces the site. You could even create a blank Entry Page that merely redirects
users to the above URL using a META tag redirect.
4b. Modify your hyperlinks to include the Shopper ID (SID).
You must add a Shopper ID (SID) tag to every internal hyperlink in every page of your web site that a customer may
traverse. When a customer visits one of your pages, the Shopping Cart script will replace this Shopper ID (SID) tag
with the customer's unique Shopper ID that was generated from the Entry Page.
You cannot add the SID tag to any external hyperlinks (links to other sites), because other sites won't even know what
an SID is. Keep in mind, though, that if a customer clicks on any hyperlink that does not contain an SID, the Shopping
Cart program will lose track of that customer and not know what items the customer has in his or her shopping cart,
unless the customer hits the back button on the browser to go back to a previous page in your site that the customer
had already visited. This means that you can add links to your pages that go to other sites (for product details, etc.),
but only if you are certain that the customer will 'back up' to a previously visited product page that contains the
customer's Shopper ID in the page's hyperlinks.
To add the Shopper ID (SID) tag to your links, modify your links a shown below:
The two parts of the URL above that are new (the /cgi-local/shop.pl/page= and /SID=PUT_SID_HERE) will be exactly
the same for every link in your web pages and must be typed exactly as shown.
If you are curious...
The above URL tells the shop.pl program, which is located in your /cgi-local/ directory, to show the file nextpage.html to the user, but first
replace all occurrences of PUT_SID_HERE with whatever Shopper ID the user currently has. In other words, this URL says, "transport the user to
nextpage.html, but remember the user's name so you can keep track of what the user added to his or her shopping cart."
4c. Create an 'add this item to your shopping cart' link for each product in your site.
In order for a shopping cart is to be useful, customers need to be able to add items to their shopping carts as they
browse your web site. You will need to add a link next to each product you sell that allows customers to add that
particular product to their shopping carts. Your link to add an item to the shopping cart should look similar to the
following:
The only parts of this link that you should change are the "page=shop.html" and the "item=3", and, of course, the text
(or image) you wish to use as the hyperlink.
page=shop.html
This signifies to which page you wish to send the customer when the customer clicks on the link. Most often you
would send the customer to your order form page so the customer can see the details of the item added to the
shopping cart, as well as make any changes to the order (i.e. change the quantity). You do not need to call your order
form page 'shop.html'; you can call it 'orderform.html' or 'shopping_cart.html' or whatever you want.
item=3
This signifies which Item ID to look up in the product list file (product_list.txt). Remember that you assigned a unique
Item ID to each product you wish to sell and listed those products in the text file product_list.txt. The Shopping Cart
program uses this Item ID to determine which line in the product list file contains the product number, description, and
price for the product the customer wishes to add to the shopping cart. It then transfers this information to the shopping
cart order form to create a list of items the customer wishes to purchase.
4d. Create a "Shopping Cart" page.
You will need to create a "Shopping Cart" page. This page shows a list of items the customer has added to his or her
personal shopping cart, the shipping methods, and the total charges for the order. It also allows the customer to
change the quantity desired of any particular item, change the shipping type, recalculate the total, or proceed to
checkout. You may design your page however you want, except for the personalized order information which is
generated by the Shopping Cart script. Use the shopping cart page in the demo (shop.html) as a guide for creating
your own page. (You can name your page anything you want.)
To add the Shopping Cart information to your page, just include the following tag in your file at the location you want it
to appear on the page:
PUT_SHOPPING_LIST_HERE
You can see from the demo shopping cart page (shop.html) that the Shopping Cart script generates the part of the
page between the two horizontal rules merely by replacing the tag "PUT_SHOPPING_LIST_HERE" with the
personalized shopping cart information.
In order to allow customers to change their order (quantity or shipping type), you will need to enclose the page inside a
FORM with the following action:
) as well as a submit button that says Recalculate.
4e. Create a "Billing Information" page.
You will also need to create a "Billing Information" page. This page gives a form where the customer can complete his
or her order by filling in his or her name, phone, shipping address, billing address, and payment info. In order to create
this page, you should just modify the demo page email.html because all of the form fields need to be exactly as in
the demo page. You cannot add any additional fields to the form. You can format the page to your liking, but do not
change any of the form fields. Also, make sure the page contains the following form action: