PHP code example of vis / compare_l5
1. Go to this page and download the library: Download vis/compare_l5 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/ */
vis / compare_l5 example snippets
Vis\Compare\CompareServiceProvider::class,
use Vis\Compare\Facades\Compare;
// добавить в сравнение
Compare::addCompare($idProduct, $model = "Product");
// удалить из сравнения
Compare::doRemoveCompare($idProduct);
// проверить или товара в сравнении
Compare::hasCompare($idProduct);
//вернуть количество товаров в сравнении
Compare::getCountCompare();
//вернуть все товары
Compare::getProducts($model = "Product");