1. Go to this page and download the library: Download osaris-uk/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/ */
use OsarisUk\Cart\Models\Cart;
// get carts based on their status: active/expired/pending/complete
$active_carts = Cart::active()->get();
$expired_carts = Cart::expired()->get();
$pending_carts = Cart::pending()->get();
$completed_carts = Cart::completed()->get();
namespace App;
use OsarisUk\Cart\Models\Cart as BaseCart;
class Cart extends BaseCart
{
//override or add your methods here ...
public function getSubTotalAttribute(){
return $this->attributes['total_price'];
}
public function getGrandTotalAttribute(){
//taking discount, tax etc. into account
return $this->sub_total - $this->discount;
}
}
'cart_model' => App\Cart::class,
$cart = App::make('cart');
sh
php artisan vendor:publish --provider="OsarisUk\Cart\CartServiceProvider" --tag=migrations
php artisan migrate
sh
php artisan vendor:publish --provider="OsarisUk\Cart\CartServiceProvider" --tag=config
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.