2017 © Pedro Peláez
 

library shopping-cart

Framework independent cart component for your site

image

atakajlo/shopping-cart

Framework independent cart component for your site

  • Friday, June 22, 2018
  • by atakajlo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 142 % Grown

The README.md

Shopping cart

Framework independent cart extension. Use in project whatever you want!, (*1)

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

$ composer require atakajlo/shopping-cart

or add, (*5)

"atakajlo/shopping-cart": "^1.2"

to the require section of your composer.json., (*6)

Usage

  1. Configure cart extension
use atakajlo\cart\cost\calculator\SimpleCalculator;
use atakajlo\cart\Cart;
use atakajlo\cart\item\CartItem;
use atakajlo\cart\storage\SessionStorage;
use atakajlo\cart\sort\IdComparator;

$cart = new Cart(
    new SessionStorage(),
    new SimpleCalculator(),
    new IdComparator() //optional
);
  1. Add items
$cartItem = new CartItem(1, 100, 1);
$cart->add($cartItem);
  1. Update item quantity
$cart->changeQuantityById($cartItem->getId(), 5);
  1. Get all items
$items = $cart->getItems();
  1. Get cart total cost
$totalCost = $cart->getCost()->getTotal();

Tests

$ ./vendor/bin/phpunit

License

This project is released under the terms of the MIT license., (*7)

Copyright (c) 2018, Dmytry Fedorenko, (*8)

The Versions

22/06 2018

dev-master

9999999-dev

Framework independent cart component for your site

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Dmytro Fedorenko

22/06 2018

1.2.3

1.2.3.0

Framework independent cart component for your site

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Dmytro Fedorenko

22/06 2018

1.2.2

1.2.2.0

Framework independent cart component for your site

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Dmytro Fedorenko

22/06 2018

1.2.1

1.2.1.0

Framework independent cart component for your site

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Dmytro Fedorenko

22/06 2018

1.2.0

1.2.0.0

Framework independent cart component for your site

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Dmytro Fedorenko

24/05 2018

1.1.0

1.1.0.0

Framework independent cart component for your site

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Dmytro Fedorenko

24/05 2018

1.0.3

1.0.3.0

Framework independent cart component for your site

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Dmytro Fedorenko

15/05 2018

1.0.2

1.0.2.0

Framework independent cart component for your site

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Dmytro Fedorenko

08/05 2018

1.0.1

1.0.1.0

Framework independent cart component for your site

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Dmytro Fedorenko

08/05 2018

1.0.0

1.0.0.0

Framework independent cart component for your site

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Dmytro Fedorenko