anwar7736/shoppingcart 问题修复 & 功能扩展

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

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

anwar7736/shoppingcart

Composer 安装命令:

composer require anwar7736/shoppingcart

包简介

Make a simple shopping cart package by using laravel

README 文档

README

This is a laravel simple shopping cart package. You can use this package very easily. Please follow these instructions for use this package.

Installation

composer require anwar7736/shoppingcart

Configuration

  1. Open config/app.php and add this line to your Service Providers Array.
Anwar\ShoppingCart\ShoppingCartServiceProvider::class
  1. Open config/app.php and add this line to your Aliases
'Cart' => Anwar\ShoppingCart\Facades\Cart::class
  1. Optional configuration file (useful if you plan to have full control)
php artisan vendor:publish --provider="Anwar\ShoppingCart\ShoppingCartServiceProvider"

How to use

use Anwar\ShoppingCart\Facades\Cart;

//Add single item to cart
Cart::add(id, name, quantity, price, discount(optional), variation(optional), image(optional));


//Get single item from cart
Cart::get(id);


//Update single item from cart(you can update quantity or variation or both)
Cart::update(id, quantity(optional), variation(optional));


//Remove single item from cart
Cart::remove(id);


//Get how many items in your cart
Cart::count();


//Get all cart items
Cart::content();


//Get total discount amount in your cart
Cart::discount();


//Get subtotal in your cart
Cart::subtotal();


//Remove all items from your cart
Cart::destroy();

Thank You

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-29