Skip to content
An implementation of android shopping cart library project for Android
Branch: master
Clone or download
Latest commit 889e180 Feb 9, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo Allow navigation to the product page from shopping cart Jun 29, 2016
gradle/wrapper
library Clean up code and formatting Oct 19, 2015
.gitignore
LICENSE
README.md Add link to demo module May 16, 2016
build.gradle
gradlew Migrate code to Gradle project structure Oct 19, 2015
gradlew.bat Migrate code to Gradle project structure Oct 19, 2015
settings.gradle Add demo app module Oct 19, 2015

README.md

android-shoppingcart

An implementation of android shopping cart library project for Android.

To use this library, follow these steps:

Download and include library in your dependencies

dependencies {
    // ...
    compile project(path: ':library')
}

For any product that you want to add in your shopping cart, create a class that extends the Saleable interface and implements these 2 methods:

getName() // must return the product name
getPrice() // must return the product price

Also override equals() and hashCode() methods.

Now from anywhere in your application, you can retrieve the shopping cart with

Cart cart = CartHelper.getCart();

After retrieving the shopping cart, the library provides various methods to manipulate the shopping cart like adding, removing, updating products or clear the entire shopping cart.

For an example on how to use this library, please see the demo (https://github.com/tonyvu2014/android-shoppingcart/tree/master/demo) app module.

You can’t perform that action at this time.