In this video we are going to learn about Add SaveForLater Option on Cart Page.
So let see how can we add SaveForLater Option on Cart Page.
Switch to the project and lets open the CartComponent.php class file.
Inside this file lets create a function for Switch Product to SaveForLater.

public function switchToSaveForLater($rowId)
$item = Cart::instance('cart')->get($rowId);
session()->flash('success_message','Item has been saved for later');

Now lets open cart-component.blade.php view file lets add a link for SaveForLater as following.

<div class=\"quantity\">
<div class=\"quantity-input\">
<input type=\"text\" name=\"product-quatity\" value=\"{{$item->qty}}\" data-max=\"120\" pattern=\"[0-9]*\" >
<a class=\"btn btn-increase\" href=\"#\" wire:click.prevent=\"increaseQuantity('{{$item->rowId}}')\"></a>
<a class=\"btn btn-reduce\" href=\"#\" wire:click.prevent=\"decreaseQuantity('{{$item->rowId}}')\"></a>
<p class=\"text-center\"><a href=\"#\" wire:click.prevent=\"switchToSaveForLater('{{$item->rowId}}')\">Save For Later</a></p>

Now lets display all items which are saved for later. so for that lets copy this cart wrap div.
And just copy and paste after this summary div and make changes as following.

<div class=\"wrap-iten-in-cart\">
<h3 class=\"title-box\" style=\"border-bottom: 1px solid; padding-bottom:15px;\">{{Cart::instance('saveForLater')->count()}} item(s) Saved For Later</h3>
<div class=\"alert alert-success\">
<strong>Success</strong> {{Session::get('s_success_message')}}
@if(Cart::instance('saveForLater')->count() > 0)
<h3 class=\"box-title\">Products Name</h3>
<ul class=\"products-cart\">
@foreach (Cart::instance('saveForLater')->content() as $item)
<li class=\"pr-cart-item\">
<div class=\"product-image\">
<figure><img src=\"{{ ('assets/images/products') }}/{{$item->model->image}}\" alt=\"{{$item->model->name}}\"></figure>
<div class=\"product-name\">
<a class=\"link-to-product\" href=\"{{route('product.details',['slug'=>$item->model->slug])}}\">{{$item->model->name}}</a>
<div class=\"price-field produtc-price\"><p class=\"price\">${{$item->model->regular_price}}</p></div>
<div class=\"quantity\">
<p class=\"text-center\"><a href=\"#\" wire:click.prevent=\"moveToCart('{{$item->rowId}}')\">Move To Cart</a></p>
<div class=\"delete\">
<a href=\"#\" wire:click.prevent=\"deleteFromSaveForLater('{{$item->rowId}}')\" class=\"btn btn-delete\" title=\"\">
<span>Delete from save for later</span>
<i class=\"fa fa-times-circle\" aria-hidden=\"true\"></i>
<p>No item saved for later</p>

Now lets create function for moving product to the cart
So go to the CartComponent class file and lets create a function here
Also create a function for delete fromSaveForLater

public function moveToCart($rowId)
$item = Cart::instance('saveForLater')->get($rowId);
session()->flash('s_success_message','Item has been moved to cart');

public function deleteFromSaveForLater($rowId)
session()->flash('s_success_message','Item has been removed from save for later');

Now its done so lets check it so switch to the browser and refresh the page.
Now go to the shop page and lets add product to the cart.
Add one more product to the cart.
Now you can see the save for later link.
Now click on it.
Now you can see here product has been moved to save for later.
And here you can see the no of product in saved for later.
Now for moving the product from save for later to cart lets click on this link.
You can see here product has been move into cart.
alright Now lets remove this product from save for later so just click on this cross icon.
And you can product has been removed from save for later.
So in this way you can use save for later option on Cart Page.