PHP code example of lenius / laravel-ecommerce
1. Go to this page and download the library: Download lenius/laravel-ecommerce 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/ */
lenius / laravel-ecommerce example snippets
Cart::insert(new Item([
'id' => 'foo',
'name' => 'bar',
'price' => 100,
'quantity' => 2,
'weight' => 300
]));
class CustomItem implements ItemInterface
{
}
Cart::insert(new Item([
'id' => 'foo',
'name' => 'bar',
'price' => 100,
'quantity' => 2,
'weight' => 300,
'options' => [
[
'name' => 'Size',
'value' => 'L',
'weight' => 50,
'price' => 10
],
],
]));
Cart::insert(new Item([
'id' => 'mouseid',
'name' => 'Mouse',
'price' => 100,
'quantity' => 1,
'tax' => 25,
'weight' => 200
]));
foreach (Cart::contents() as $item) {
$item->name = 'Foo';
$item->setQuantity(1);
}
Cart::destroy()
Cart::contents();
Cart::contents(true);
Cart::has($itemIdentifier);
Cart::remove($itemIdentifier)
Cart::inc($itemIdentifier)
Cart::dec($itemIdentifier)
bash
php artisan vendor:publish --provider="Lenius\LaravelEcommerce\EcommerceServiceProvider" --tag="config"
php artisan vendor:publish --provider="Lenius\LaravelEcommerce\EcommerceServiceProvider" --tag="lang"
php artisan vendor:publish --provider="Lenius\LaravelEcommerce\EcommerceServiceProvider" --tag="views"