Download the PHP package kbcart/zf3-kbcart without Composer

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

ZF3KbCart

simple shopping cart for zend frame work 3 KbCart

A Simple shopping cart for zf3. Based on the information provided by routes in your website, use the functionality of it. I did not use hydrator in this version just simple array to array with no stuff attached. I got the basic idea from Aleksander Cyrkulewski who used hydrator, I used zend-config xml file creation and delete and collect the stuff in an array, obtaining data directly from array, here the user could specify as many as subcategories needed by following my way and reflech it in shopping cart view of her/his website. Do not forget you need zend-config and zend-crypt to use this module.

Zend Framework 2 and 3

This module could be used both in zf2 and zf3

Installation

For the installation uses composer composer. Add this project in your composer.json:

"require": {
    "kbcart/zf3-kbcart": "@dev"
}

Post Installation

Configuration:

Examples

Before showing examples, few explanations could be to your benefit: Supposing you have a store, each item is located in a page, clicking on it directs your customer to detailed page for that item with the help of its route. the customer selects the item with the required quantity, all reflected in route. To have category and subcategorie(s), this data must be reflected as an option or param in route (directly or via getting breadcrumb) then fixing the param option in route for that form. The protocol must be like this: $this->url('routename', [], ['query'=>['category':'category-subcategory-...']]). In related action controller: $this->kbcart();

Insert

You can insert as many items to the cart as you want. Each entry in cart will have unique token to work with. In related controller include: use Zend\Config\Config; use Zend\Config\Writer\Xml;

in controller action:

$kbcart = $this->kbcart();

 $config = new Config([], true);
 GET $category from query as explained above. e.g:
 $category='books-physic-newton';
 $config->$category=[];
 you MUST do exactly according below, the same order and words:
 the values below is obtained by route, remember no money sign like Euro or dollar sign for price, just float numbers.
 $config->$category->itemid="1";
 $config->$category->name="principa";
 $config->$category->price="19.19";
 $config->$category->quantity="1";

 $writer = new Xml();

 a temporary file will be created, if two or more users apply for the same item at the same time,
 randome functions prevent from being created the same file for different customers.

  srand(time());
  $num=rand(1, 1000);

 $writer->toFile(__DIR__.'/../kbcart_'.$num.'.xml',$config);
 $kbcart->insert(__DIR__.'/../kbcart_'.$num.'.xml');

 The created file shall be deleted automatically after insert into your cart.
 Also you can use var_dump($this->kbcart()->cart) to check the content of basket.

Remove

Update

Destroy

Erase Kb Cart completely.

Cart

View all contents of cart:

Total Sum

To pass the cart to view template

KbCart

The provided cart is quite practical, having the itemid, all data to that item is accessible from database or file no need to make cart more complex with other options like discount , ... So the simpler the more practical. For insert: In action controller first check the cart and its items. suppose the customer selected the same item two different times if not, then insert should be used.

Main Functions

Function Description
$this->kbcart()->insert();Add item(s) to cart.
$this->kbcart()->remove();Delete the item from the cart.
$this->kbcart()->destroy();Delete all items from the cart.
$this->kbcart()->cart();Extracts all items from the cart.
$this->kbcart()->cartTotalPrice();Counts the total sum of all items in the cart.
$this->kbcart()->update();to update the quantity for an item.

Developed by

Kian William Nowrouzian - [email protected]


All versions of zf3-kbcart with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
zendframework/zend-config Version 3.*
zendframework/zend-crypt Version 3.*
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 kbcart/zf3-kbcart contains the following files

Loading the files please wait ....