|
|
|
@@ -29,9 +29,7 @@ export class OutletDetailsPage implements OnInit { |
|
|
|
private location: Location, |
|
|
|
) { } |
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
|
|
|
|
} |
|
|
|
ngOnInit() { } |
|
|
|
|
|
|
|
getFormatterDateTime(date: any, format: string) { |
|
|
|
return moment(date).format(format); |
|
|
|
@@ -40,8 +38,21 @@ export class OutletDetailsPage implements OnInit { |
|
|
|
ionViewDidEnter() { |
|
|
|
this.outlet_details = JSON.parse(this.route.snapshot.paramMap.get('outlet')); |
|
|
|
this.mallId = Number(this.route.snapshot.paramMap.get('mallId')); |
|
|
|
this.fetchCartItems(); |
|
|
|
} |
|
|
|
|
|
|
|
fetchCartItems() { |
|
|
|
if (localStorage.userCart) { |
|
|
|
this.userCart = JSON.parse(localStorage.userCart); |
|
|
|
} else { |
|
|
|
localStorage.userCart = JSON.stringify(this.userCart); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ionViewDidLeave() { |
|
|
|
localStorage.userCart = JSON.stringify(this.userCart); |
|
|
|
} |
|
|
|
|
|
|
|
addToCart(item: any) { |
|
|
|
this.userCart.orderedlist.push({ |
|
|
|
mall_id: this.mallId, |
|
|
|
@@ -54,8 +65,6 @@ export class OutletDetailsPage implements OnInit { |
|
|
|
total_price: item.item_price, |
|
|
|
soft_delete: false |
|
|
|
}); |
|
|
|
|
|
|
|
console.log(this.userCart); |
|
|
|
} |
|
|
|
|
|
|
|
isItemPresentInCart(itemId: number) { |
|
|
|
|