Fully Functional Client Side Shopping Cart Plugin in Jquery
Cesta-Feira jQuery plugin for creating and manipulating a simple shopping cart on your website.
- Full client-side operation (use of server-side languages is optional);
- Totally customizable with regard to item details when adding to cart;
- Browser support: Firefox, Chrome, Safari, IE8+, iOS, Android, Opera;
- Small file size and simple to implement;
- Based on metadatas of DOM;
- Callback API and public methods.
Creating Simple Shopping Cart
Below going to create a very basic add to cart feature using this plugin.
Create a form element with the metadata data-cesta-feira-form form <form data-cesta-feira-form> and with elements <input> with the metadata data-cesta-feira-attribute for each information of item to be added into the basket. Any text content is valid, and you can add as many inputs as you want. Only the <input> containing the product ID is required, being marked as follows: <input value=”1″ data-cesta-feira-item-id>
<form data-cesta-feira-form> <input type="hidden" value="1" data-cesta-feira-item-id> <input type="number" name="quantity" data-cesta-feira-attribute> <input type="text" name="observations" data-cesta-feira-attribute> </form>
Finally call the plugins .Cesta-Feira(). Note that the call must be made inside of a $(document).ready() call, or the plugin will not work!