diff --git a/src/app/cart/cart.page.html b/src/app/cart/cart.page.html
index ea4da37..43f01b6 100644
--- a/src/app/cart/cart.page.html
+++ b/src/app/cart/cart.page.html
@@ -16,19 +16,23 @@
+
+
+ -
+
+
+ {{ getPickupTimeFormat(item.pickup_time) }}
+ Schedule time
+
+
+
+
+
-
{{ i + 1 }}. {{ item.menu_details.name }}
- ₹ {{ item.total_price }}
- -
-
-
- {{ getPickupTimeFormat(item.pickup_time) }}
- Schedule time
-
-
-
- -
-
-
- {{ getPickupTimeFormat(item.pickup_time) }}
- Schedule time
-
-
-
-
@@ -56,9 +51,9 @@
-
- Add on
+
+ Add on
diff --git a/src/app/cart/cart.page.scss b/src/app/cart/cart.page.scss
index dbc95b0..c50d417 100644
--- a/src/app/cart/cart.page.scss
+++ b/src/app/cart/cart.page.scss
@@ -90,12 +90,10 @@ ul {
.cart-item-list {
width: 90%;
margin: 0 auto;
- padding-bottom: 15px;
border-bottom: 1px solid #efefef;
.cart-item {
display: none;
- margin-top: 20px;
&.show {
display: block;
@@ -109,12 +107,14 @@ ul {
justify-content: space-between;
font-weight: bold;
color: dimgrey;
+ width: 95%;
+ margin: 0 auto;
&.outlet {
background-color: #efefef;
color: var(--brand-grey);
- margin-bottom: -10px;
padding: 5px 10px;
+ width: 100%;
}
ion-button {
@@ -133,7 +133,13 @@ ul {
font-size: 10px;
margin: 0;
height: 25px;
- margin-top: 10px;
+ margin-top: 0px;
+ margin-bottom: 10px;
+ display: none;
+
+ &.show {
+ display: inline-block;
+ }
}
}
@@ -141,12 +147,19 @@ ul {
color: var(--brand-dark-grey);
font-size: 12px;
font-weight: 500;
+ width: 95%;
+ margin: 0 auto;
+ padding: 7px 0;
li {
display: flex;
justify-content: space-between;
align-items: center;
- margin: 1px auto;
+ width: 100%;
+
+ &.hidden {
+ display: none;
+ }
}
ion-button {
diff --git a/src/app/cart/cart.page.ts b/src/app/cart/cart.page.ts
index 37d6bb1..e64c72a 100644
--- a/src/app/cart/cart.page.ts
+++ b/src/app/cart/cart.page.ts
@@ -59,7 +59,7 @@ export class CartPage implements OnInit {
this.cartService.getAllCartItems().then((cart_items: Array) => {
this.cart_items = cart_items;
- let i: number, j: number;
+ let i: number;
for (i = 0; i < this.cart_items.length; i += 1) {
let mall = this.all_malls.find(mall => mall.id === this.cart_items[i].mall_id);
@@ -76,6 +76,19 @@ export class CartPage implements OnInit {
});
}
+ isMaxDeliveryTime(outlet_id: string) {
+ let pricing = this.cart_items.filter((item => item.outlet_id === outlet_id));
+ if (pricing.length > 0) {
+ let max = pricing.reduce((prev, current) => {
+ return (prev.pickup_time > current.pickup_time) ? prev : current
+ });
+ return max;
+ } else {
+ return 0;
+ }
+
+ }
+
openInstantMenu(item: any) {
this.instant_menu = true;
this.mallService.getMallByID(item.mall_id).then((data: IMall) => {
@@ -107,8 +120,7 @@ export class CartPage implements OnInit {
}
decreaseCartItemCount(item: any) {
- console.log(item);
- let i: number, cart_items;
+ let i: number, cart_items : any;
for (i = 0; i < this.cart_items.length; i += 1) {
if (this.cart_items[i].menu_item === item.menu_item) {
this.cart_items[i].quantity -= 1;
@@ -238,6 +250,7 @@ export class CartPage implements OnInit {
this.orderService.createOrder(this.cart_items, calculated_total, this.selected_promocode).then(() => {
this.presentToast('Order has been created! :-)', 'dark');
this.cartService.clearCartItems();
+ document.querySelector('.menu-icon-holder').classList.remove('hide');
this.router.navigate(['/profile']);
}, () => {
this.presentToast('Failed to create the order, We\'re sorry for the inconvenience', 'danger');