Easy Basket, Free AJAX Shopping Cart with Paypal & Google Checkout


Easy Basket API


JavaScript API


To enable various functions of Easy Basket javascript API you alter the content part of the meta tag below.

<meta name="easybasket" content="location=easybasket/;dragdrop=yes;showhide=yes;" />

If you apply a setting for drag or drop, dragdrop will be  automatically  enabled
If you apply a setting for showhidecontrol or showhidearea , showhide will be automatically enabled

Options are, default value in red

location = easybasket/ The location of the easybasket folder.
drag = .drag The class name for any area that will be drag-able.
drop = .easybasket The class name for any area that will be drop-able.
dragdrop = false The default setting of drag and drop.
showhidecontrol = #showhidecontrol The id of the show hide control.
showhidearea = .showhidearea The class of the show hide area.
showhide = false The default setting for show hide.
bubblettimeout = 2000 Timeout for add to cart notification.
basketdelay = 3000 The time that the basket stays open.

Examples
Enable show hide with default id and class names
<meta name="easybasket" content="showhide=yes" />

Enable show hide with default id and class names and change the slide time
<meta name="easybasket" content="showhide=yes;basketdelay=5000" />

Enable drag and drop with default id and class names
<meta name="easybasket" content="dragdrop=yes" />

HTML API

The HTML API has two functions, the first being when a page is loaded a HTTP GET and the second when a form is posted a HTTP POST

HTTP GET commands

<div data-url=”skin=test.xsl”></div>
The basket rendered as HTML using the specified skin file.

<div data-url=”debug=basic”></div> (basic | advanced)
The basket as raw XML instead of rendered using a skin.

HTTP POST commands

<form class="easybasket" method="post" action="?basket=add">
Add an item to the basket. Increase the item quantity by either 1 or the value of the form quantity field if present.

<form class="easybasket" data-bubble="Add to Basket" method="post" action="?basket=add">
You can also add data-bubble="Add to Basket" to the above form tag to have a Add To Basket notification displayed on the screen when you add an item to the basket

The commands below are really only used in a skin file

<form class="easybasket" method="post" action="?basket=remove">
Remove an item from the basket.

<form class="easybasket" method="post" action="?basket=increase">
Increase the quantity of an item in the basket by 1.

<form class="easybasket" method="post" action="?basket=decrease">
Decrease the quantity of an item in the basket by 1.

<form class="easybasket" method="post" action="?basket=reset">
Empty the basket. Remove all items from the basket.

<form class="easybasket" method="post" action="?basket=paypal">
Invoke the Paypal checkout.

<form class="easybasket" method="post" action="?basket=google">
Invoke the Google checkout.