1. Go to this page and download the library: Download neyromanser/laravel-shop 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/ */
neyromanser / laravel-shop example snippets
return [
'currency' => "грн."
];
# Add to cart
Shop::Cart()->add([
'id' => $id,
'name' => $name,
'qty' => $request->input('qty', 1),
'price' => $item->price,
'options' => $options
]);
# Remove from cart
Shop::Cart()->remove($id);
# Update cart
Shop::Cart()->update($id, $quantity);
# Cart total sum
Shop::Cart()->total()
# Cart positions amount
Shop::Cart()->count()
# Cart total products units
Shop::Cart()->count(false)
# Search in cart
Shop::Cart()->search(['id' => 123]);
# Associate cart with App\Model\Product
Shop::Cart()->associate('Product', 'App\\Model')
# New cart instance
Shop::Cart()->instance('wishlist')