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

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

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

abstracteverything/cart

Composer 安装命令:

composer require abstracteverything/cart

包简介

Cart session manager

README 文档

README

Manage cart items using sessions.

Install

Run composer require abstracteverything/cart or add:

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

to your composer.json file and run composer update.

Add AbstractEverything\Cart\CartServiceProvider to your providers array.

Export the config file using php artisan vendor:publish.

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();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固