Source Code
Add to cart
Now we have to pick the add to cart of product by using wire bind as like:
wire:click.prevent="store({{$product->id}},'{{$product->name}}',{{$product->regular_price}})"
Additionally, we can use the method of count() for checking there is any product or not! For that we can use the loop like:
@if(Cart::count()>0)
// go for product
else
No Products
@endif
Fetch product image from database
src="{{asset('assets/images/products')}}/{{$item->model->image}}"
Route action
href="{{route('product.details',['slug'=>$item->model->slug])}}"
Rest of the functions of building cart package
- Subtotall
- Total
- Tax
Top comments (0)