Download the PHP package lachezargrigorov/laravel-shopping-cart without Composer

On this page you can find all versions of the php package lachezargrigorov/laravel-shopping-cart. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-shopping-cart

Laravel Shopping Cart

Latest Stable Version Latest Unstable Version Build Status Total Downloads

An easy to use more advanced shopping cart for Laravel applications.

Installation

Via Composer

Laravel 5.5 and above uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider and Facade to the array in config/app.php

If you don't use auto-discovery, add the CartServiceProvider to the providers array in config/app.php

If you want to use the Cart facade, add this to the aliases array in app.php:

Implement the Item interface in your product model. The Cart and Item uses getCartPrice method to calculate the totals.

Publish the package config to your local config with the publish command and configure them:

Set the item_class in local package config (cart.php)

Legend

Elements

Interfaces

Collections

Exceptions

Usage`

Cart

Item

Add or get Item

This method add or get an Item if exist.

Models loading process

For better performance models are lazy associated to the items on first '$item->model' call after init or item addition in single DB request so you don't need to add any extra data like name, price, etc.

Remove Item

-return : removed Item

Get items
Has item (Item)
Get items count
Remove items (Item)
Remove all cart items
Is empty for items
Get item keys
Empty the item models

This will case the cart to reload the models on next model call.

CartCondition

Add or get CartCondition

This method add or get an CartCondition if exist.

Add or set CartConditions as array

This will rewrite the existing conditions.

Get conditions
Has condition
Get conditions count
Remove conditions
Remove all cart conditions
Is empty for conditions
Get condition keys (names)

Total methods

Get total quantity
Get cart subtotal without applied ItemConditions and CartConditions
Get cart subtotal without applied CartConditions
Get cart total with applied ItemConditions and CartConditions

Item

Properties

Set quantity
Add quantity (current quantity + added quantity)
Get quantity
Set attributes
Get attributes
Empty attributes (delete all attributes)
Add or get ItemCondition

Add or set ItemConditions as array

This will rewrite the existing conditions.

Get conditions
Remove ItemCondition

return : removed ItemCondition

Has condition
Does item contain any conditions
Empty conditions (remove all conditions)
Get model

Price methods

Get price without applied conditions

-return : double

Get price sum without applied conditions (price * quantity)

-return : double

Get price with applied conditions

-return : double

Get price sum with applied conditions (price * quantity)

-return : double

Set helper

Condition (CartCondition and ItemCondition)

Properties

Set name

This will change the key in collection too.

Get name
Set type
Get type
Set value
Get value
Set attributes

Merge existing attributes.

Get attributes
Empty attributes (delete all attributes)

Set helper

Testing

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-shopping-cart with dependencies

PHP Build Version
Package Version
Requires illuminate/config Version ^5.1
illuminate/support Version ^5.1
illuminate/database Version ^5.1
php Version ^5.6|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lachezargrigorov/laravel-shopping-cart contains the following files

Loading the files please wait ....