neon-php/simple-cart 问题修复 & 功能扩展

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

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

neon-php/simple-cart

Composer 安装命令:

composer require neon-php/simple-cart

包简介

Simple Shopping Cart Handler

README 文档

README

Simple session based shopping cart handler

Simple Usage

<?php

use Neon\Cart;

// Create a new cart instance
$cart = Cart::instance('my_instance_key');

// Adding items to cart 
$product_id = 1;
$cart->add(item_id: $product_id, quantity: 3);
Cart::instance('my_instance_key')->add(item_id: $product_id, quantity: 3);

// Removing items from cart
// Removes two instances of the item with the id 1 from the cart
$cart->removeByItemId(item_id: 1, quantity: 2);
Cart::instance('my_instance_key')->removeByItemId(item_id: 1, quantity: 2);

// Fetching the whole cart content
$content = $cart->content();
$content = Cart::instance('my_instance_key')->content();

// Destroying the whole cart content
$cart->destroy();
Cart::instance('my_instance_key')->destroy();

// Removing all instances of a given item ID
$cart->destroyByItemId(1);
Cart::instance('my_instance_key')->destroyByItemId(1);

// Counting all items in the cart
$count = $cart->count();
$count = Cart::instance('my_instance_key')->count();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固