JavaScript Shopping Cart ecommerce PayPal

SoftXML
           Programming Books | XML Press
                Open Web Directory
           SoftXMLLib | SoftXMLEcartJS
Contact Us












SoftXMLEcart(js) - easy, xml based ecommerce shopping cart written in JavaScript with built-in PayPal integration.

Sign up for PayPal and start accepting credit card payments instantly.

Advantages of using a SoftXMLEcart(js):

# It is designed to be small, fast, powerful, yet easy to install for even the most novice web designer. Within minutes of installing the cart, you can be selling your products online. All you need to get started is an active PayPal account, the rest applications will do for you.

# The application requires no third party software, all you need is a web browser.

# You do not need to have advanced web hosting that supports server-side programming languages, all that is necessary for the application to work is a client-side language JavaScript and HTML. You just copy the original application files to your server and access the home page in following manner: http://www.yoursite.com/ecartjs/shopcart.htm

Browsers supported:
FireFox [2.0,3.0] Opera [9.63, 9.64] Google Chrome 1.0.154.65 Internet Explorer [6,7] Safari 3.2.1 Netscape Navigator 9.0.0.6 K-Meleon 1.5.3 Maxthon 2.5.1.4751 UNICODE

SoftXMLEcart(js) configuration:

SoftXMLEcart(js) uses the XML file as a data source. "Data.xml" file located in root folder and can be configured to fit your needs:

1) To display the categories and products offered for sale.
2) To design look and feel of the shopping cart.

File structure - Data.xml

This file consist of categories and products, each category can have multiple products.

Setting up categories and products

<category id="1" name="XML Products">
category tag has two must have attributes and multiple product elements:
"id":      Unique Identifier, value of this attribute should be unique and not be repeated within category tags
"name": value of this attribute will be displayed as category name on your shopping cart

<product id="1" price="15.55" shippingcost="10.05">
product tag has three must have attributes and three must have child elements:
"id":      Unique Identifier, value of this attribute should be unique and not be repeated within product tags
"price": value of this attribute must be a decimal and will be used to calculate cost of this product
"shippingcost": value of this attribute must be a decimal and will be used to calculate shipping cost of this product

<product> tag must have following child elements:
<title>SoftXpath library</title> tag is used to display product name on your shopping cart
<description>some text about javascript library</description> tag is used to display product description on your shopping cart
<image link="http://www.softxml.com" width="181" height="181">images/1369401655_dotpeak_products1.gif</image> tag has three must have attributes
"link": URL to online resource used when user clicks product's image
"width": image width in pixels
"height": image height in pixels

Product's image should be placed in images folder of shopping cart

Designing look and feel of the shopping cart

<cart logo="images/softxmlogo.gif" category-font-family="arial" category-font-size="19px" category-color="#ff0000" product-title-font-family="arial" product-title-font-size="13px" product-title-color="#000000" product-price-font-family="arial" product-price-font-size="13px" product-price-color="#ff0000" product-description-font-family="arial" product-description-font-size="12px" product-description-color="#000000"> tag defines shopping cart logo,colors,fonts and etc..

Data.xml file

JavaScript Configuration

myCart = new SoftXMLCart();   //CREATE instance of shopping cart
myCart.currency="EUR"   //set currency of your shopping cart, see list of paypal currency codes
myCart.productsPerRow="4";   //number of products displayed on each row
myCart.productBGColor="#CCCCCC";   //set background color of product box
myCart.setDefaultCategoryID("2");   //set default category ID to be displayed
myCart.setPayPalEmail("info@softxml.com"); //set your paypal email for order process

Useful cart functions

myCart.js2xml();  //get content of the shopping cart in xml format
myCart.xml2json();  //get content of the shopping cart in json format

SoftXMLEcart(js) Demo Page

download SoftXMLEcart(js)
Use this form to send your feedback, bug alerts or questions related to using SoftXMLEcart(js).
If you have implemented SoftXMLEcart(js) in real world web applications, please let us know resource URL so we can include it on SoftXML.

™SoftXML.   Privacy Statement  |  Articles Archive  |  XML Books
^Top