Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tonyvu2014/shoppingcart

A java-based shopping cart
https://github.com/tonyvu2014/shoppingcart

ecommerce shopping-cart

Last synced: about 4 hours ago
JSON representation

A java-based shopping cart

Awesome Lists containing this project

README

        

shoppingcart
============

[![Build Status](https://travis-ci.org/tonyvu2014/shoppingcart.svg?branch=master)](https://travis-ci.org/tonyvu2014/shoppingcart)

## Usage

A java-based shoppingcart.

This project contains 4 folders:

- src: the source code folder
- lib: contains the exported jar library file
- example: an example of using the shopping cart library
- doc: contains the javadoc documentations

In order to use the library, just download the shoppingcart-{latest version number}.jar from lib folder and include it in your project build path.

For any product/item that you want to add into the shopping cart, just create a class which implements the Saleable interface override equals(), hashCode() and these two methods from the interface:

- getName(): should return the name of the item
- getPrice(): should return the price of the item

A Cart object represents a shopping cart. The Cart class provides various methods to manipulate items and quantities on the shopping cart like adding items, updating quantities, removing items,... For more details, check out the javadoc from here: https://rawgit.com/tonyvu2014/shoppingcart/master/doc/index.html

For most of web-based shopping cart, you will have to store and retain the cart object in session by yourself.

## Build

To run the unit tests:

``` sh

mvn test

```

To create jar package, run:

``` sh

mvn package

````