Download the PHP package pinga/cart without Composer

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

Pinga Cart

This is a very simple PHP cart library. Cart data can either be saved in PHP session or browser cookie. Maintained and expanded by Taras Kondratyuk and based on seikan/Cart.

Usage

Configuration

  1. Install the package:

  2. Include in your main PHP script:

  3. Use in your script:
Options
Parameter Type Description
cartMaxItem int The maximum item can be added to cart. 0 = Unlimited
itemMaxQuantity int The maximum quantity per item can be added to cart. 0 = Unlimited
useCookie bool Use cookie to keep cart data when browser is closed.

Add Item

Adds an item to cart.

bool \$cart->add( string \$id[, int \$quantity][, array $attributes] );

Update Item

Updates quantity of an item. Attributes must be provides if item with same ID exists with different attributes.

bool \$cart->update( string \$id, int $quantity[, array \$attributes] );

Remove Item

Removes an item. Attributes must be provided to remove specified item, or all items with same ID will be removed from cart.

bool \$cart->remove( string $id[, array \$attributes] );

Get Items

Gets a multi-dimensional array of items stored in cart.

array \$cart->getItems( );

Get Item

Gets a multi-dimensional array of one item stored in cart.

array \$cart->getItem( string $id[, string \$hash] );

Check Cart Empty

Checks if the cart is empty.

bool \$cart->isEmpty( );

Get Total Item

Gets the total of items in the cart.

int \$cart->getTotaltem( );

Get Total Quantity

Gets the total of quantity in the cart.

int \$cart->getTotalQuantity( );

Get Attribute Total

Gets the sum of a specific attribute.

int \$cart->getAttributeTotal( string $attribute );

Clear Cart

Clears all items in the cart.

\$cart->clear( );

Destroy Cart

Destroys the entire cart session.

\$cart->destroy( );

Item Exists

Checks if an item exists in cart.

bool \$cart->isItemExists( string \$id[, array \$attributes] );


All versions of cart with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1.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 pinga/cart contains the following files

Loading the files please wait ....