2017 © Pedro Peláez
 

cakephp-plugin cakephp-cart

Cart plugin for CakePHP

image

funayaki/cakephp-cart

Cart plugin for CakePHP

  • Monday, July 30, 2018
  • by tsmsogn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Build Status Scrutinizer Code Quality codecov, (*1)

Cart plugin for CakePHP

Requirements

  • CakePHP 3.5.0 or later

Installation

You can install this plugin into your CakePHP application using composer., (*2)

The recommended way to install composer packages is:, (*3)

composer require funayaki/cakephp-cart

Implement EntityBuyableAwareInterface:, (*4)

class Item extends Entity implements EntityBuyableAwareInterface
{

    public function getPrice()
    {
        return $this->price;
    }

    public function getBuyableLimit()
    {
        return INF;
    }
}

Load CartComponent:, (*5)

<?php
class AppController extends Controller
{

    public function initialize()
    {
        parent::initialize();

        $this->loadComponent('Cart.Cart');
    }
}

Usage

Add item to cart:, (*6)

$this->Cart->add($item);

Update item quantity in cart:, (*7)

$this->Cart->edit($item, 5);

Get item(s) in cart:, (*8)

$this->Cart->get($item);
$this->Cart->get();

Calculate item total price in cart:, (*9)

$this->Cart->total($item);

Calculate total price in cart:, (*10)

$this->Cart->total();

Count quantity item(s) in cart:, (*11)

$this->Cart->count($item);
$this->Cart->count();

Delete item from cart:, (*12)

$this->Cart->delete($item);

Delete all items from cart:, (*13)

$this->Cart->clear();

The Versions

30/07 2018

dev-master

9999999-dev

Cart plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

21/03 2017

1.0

1.0.0.0

Cart plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires