1. Go to this page and download the library: Download sinbadxiii/phalcon-cart library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sinbadxiii / phalcon-cart example snippets
$di->set(
'cart',
function () use ($di) {
return new Sinbadxiii\Phalcon\Cart\CartShopping(
$di->getSession()
);
}
);
$di->set(
'compare',
function () use ($di) {
return new Sinbadxiii\Phalcon\Cart\CartShopping(
$di->getSession(), 'compare'
);
}
);
$this->cart->instance('shop')->add('100', 'Product #1', 1, 100.00);
// Get the content of the 'shop' cart
$this->cart->content();
$this->cart->instance('wishlist')->add('200', 'Product #2', 1, 20.00);
// Get the content of the 'wishlist' cart
$this->cart->content();
// If you want to get the content of the 'shopping' cart again
$this->cart->instance('shop')->content();
// And the count of the 'wishlist' cart again
$this->cart->instance('wishlist')->count();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.