mkakpabla/session-shoppingcart

There is no license information available for the latest version (1.0.1) of this package.

1.0.1 2019-10-20 20:21 UTC

This package is auto-updated.

Last update: 2024-06-21 20:07:09 UTC


README

Build Status

Shopping Cart

Requirements

  • PHP 7.2 or higher
  • Composer for installation

Quick Start

Installation

composer require "mkakpabla/shoppingcart"

Usage

<?php

require 'vendor/autoload.php';

$cart = new Cart();

$cart->addItem(1, [
    'name' => 'item1',
    'price' => 'item2'
], 2);

// Return the list of the CartItems
$items = $cart->getItems();

// Return the price of the cart
$cartPrice = $items->totalPrice()