Download the PHP package bobkingstone/pedlar-cart without Composer

On this page you can find all versions of the php package bobkingstone/pedlar-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 pedlar-cart

Pedlar-Cart Laravel Package

Build StatusLatest Stable Version Total Downloads Latest Unstable Version License

Laravel e-commerce shopping cart package. It uses Laravel's Session class by default.

Installation

Add bobkingstone/pedlar-cart to your composer.json

"require": {
    "bobkingstone/pedlar-cart": "dev-master"
}

Run composer update

composer update

Once this has completed add the service provider to the array of providers in app/config/app.php

'Bobkingstone\PedlarCart\PedlarCartServiceProvider'

Usage

The package generates a 'Cart' facade for the package automatically so there is no need to add it to the alias array.

To add an item to the cart:

$item = array(
    'id => '1', //your cart id
    'qty' => 2,
    'price' => 200.00,
);

$CartItemIdentifier = Cart::insert($item);

To get the total number of all items in cart:

Cart::countItems();

To get an array of CartItems from cart:

Cart::all();

To access cart items values:

foreach (Cart::all() as $item)
{
    echo $item->id;
    echo $item->price;
    echo $item->qty;
};

To get the total value of all items in cart:

Cart::totalValue();

To get a count of unique items in cart:

Cart::totalUniqueItems();

To empty the cart:

Cart::clear();

To set tax rate, you can either add it to each item:

$item = array(
    'id => '1',
    'qty' => 2,
    'tax' => 20,
    'price' => 200.00,
);

Cart::totalWithTax();

Or pass in the percentage with the cart total calculation (this will override each items predefined tax rate):

Cart::totalWithTax(20);

To update an item

$item = Cart::find('91936a0df88d531b5a770b614cd3c1ea');

$item->update('qty','3');

This will replace the existing value, to add to the quantity add the same item:

$item = array(
        'id => '1',
        'qty' => 2,
        'price' => 200.00,
    );

Cart::insert($item);

The item quantity will automatically be added.

To remove a single item from cart:

Cart::remove('91936a0df88d531b5a770b614cd3c1ea');

Exceptions

The package will throw InvalidNumberOfValuesException if one of the following required params is missing:

$requiredParams = array (
    'id',
    'qty',
    'price'
);

It will also throw InvalidItemKeyException if an invalid update is passed to a cart item.

Notes

Using dd() to view cart contents will interrupt Laravels Session storage functions and can prevent the cart from being updated.


All versions of pedlar-cart with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.2.*
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 bobkingstone/pedlar-cart contains the following files

Loading the files please wait ....