You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

52 lines
2.1 KiB

<ng-container *ngIf="cartdetails.length !=0">
<div class="container">
<div class="card-table">
<div class="card-product">
<div class="table tabe-responsive">
<thead>
<tr>
<th>S.No</th>
<th>ProductName</th>
<th>ProductPrice</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let c of cartdetails; let i = index">
<td>{{i+1}}</td>
<td>{{c.productname}}</td>
<td>{{c.productprice}}</td>
<td>
<button class="CartButtons" (click)="removeItem(c)">Delete</button>
</td>
</tr>
<tr>
<td colspan="4"></td>
<td><button (click)=emptyCart() class="CartButtons">Empty Cart</button></td>
<td><button routerLink='/home' class="CartButtons">Shop More</button></td>
<td><button class="CartButtons">Checkout</button></td>
<td><strong>Grand Total : Rs.{{grandTotal}}</strong></td>
</tr>
</tbody>
</div>
</div>
</div>
</div>
</ng-container>
<ng-container *ngIf="cartdetails.length==0">
<div class="container">
<div class="card">
<h5 class="card-title">My Cart</h5>
</div>
<div class="center">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT9q9U7YaUc27iaqP1bbyD3g6GSLqlRmAFbeQ&usqp=CAU"
alt="">
<h4>Your cart is empty!</h4>
<h6>Add item to it now</h6>
<button class="shopNow" routerLink='/home'>Shop Now</button>
</div>
</div>
</ng-container>