2017 © Pedro Peláez
 

library cart

Cart session manager

image

abstracteverything/cart

Cart session manager

  • Friday, June 2, 2017
  • by AbstractEverything
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Cart management for Laravel

Manage cart items using sessions., (*1)

Install

Run composer require abstracteverything/cart or add:, (*2)

{
    "require": {
        "abstracteverything/cart": "dev-master"
    }
}

to your composer.json file and run composer update., (*3)

Add AbstractEverything\Cart\CartServiceProvider to your providers array., (*4)

Export the config file using php artisan vendor:publish., (*5)

Usage

// Add cart items:

$cart->add(123abc, 'Grapes', 12.50, 2, [
    'variety' => 'green',
    'type' => 'seedless',
]);

// Add more than one item to the cart

$cart->addMany([
    [
        'id' => 'item1',
        'name' => 'Test item 1',
        'price' => 123,
        'quantity' => 1,
        'options' => [],
    ],
    [
        'id' => 'item2',
        'name' => 'Test item 2',
        'price' => 234,
        'quantity' => 2,
        'options' => [],
    ],
]);

// Find cart item by its id:

$cart->find(123abc);

// Get all the items in the cart:

$cart->all();

// Calculate total price of all items:

$cart->subtotal();

// Calculate the total tax of all items:

$cart->tax();

// Calculate total price with tax of all items:

$cart->subtotalWithTax();

// Remove an item by its id:

$cart->remove(123);

// Count the number of items in the cart:

$cart->count();

// Remove all items from the cart:

$cart->clear();

The Versions

02/06 2017

dev-master

9999999-dev

Cart session manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by R Franks

02/06 2017

v1.0.0

1.0.0.0

Cart session manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by R Franks