metator/cart 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

metator/cart

Composer 安装命令:

composer require metator/cart

包简介

Simplest 'cart' class ever written.

README 文档

README

Coverage Status Build Status

Metator Cart

The simplest shopping cart class ever to exist. For a full stack shopping cart system, check out metator/application.

The cart class class is hopefully very intuitive. It depends on nothing, and assumes nothing except that your items have a unique identifier.

use Metator\Cart\Cart;

$cart = new Cart;
$cart->add(5);
$cart->add(5);
$cart->add(5);

echo $cart->quantity(5); // 3
print_r($cart->items()); // array(5)

$cart->remove(5);
echo $cart->quantity(5); // 0
print_r($cart->items()); // array()

$cart->add(5);
$cart->setQuantity(5,500);

echo $cart->quantity(5); // 500

$cart->setQuantity(5,0);
print_r($cart->items()); // array()

##Understanding Identifiers## The value for the ID could be the auto_increment from your database, a product SKU, or any kind of unique identifier like a hash. For example if a T-Shirt comes in multiple colors but always has the same SKU & ID regardless of color, you could use a hash representing the configured state of that product for the id here.

统计信息

  • 总下载量: 204
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2013-07-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固