Skip to content

Commit

Permalink
#115 added custom order option
Browse files Browse the repository at this point in the history
  • Loading branch information
tareq89 committed Aug 20, 2016
1 parent 67e2ee7 commit 809a237
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
12 changes: 11 additions & 1 deletion app/vendor-menu/vendor-menu.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
}

@media only screen and (max-width: 780px){

.vendor-name-div h1 {
padding: 0;
position: relative;
z-index: 2;
}
.vendor-item-list {
display: block;
width: 100%;
Expand Down Expand Up @@ -91,4 +97,8 @@ li a {
.selected-item-img {
width: 100%;
margin-bottom: 20px;
}
}

textarea {
width: 100%;
}
13 changes: 12 additions & 1 deletion app/vendor-menu/vendor-menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ <h1 class="text-center">{{vendor.name}}</h1>
</ul>
</div>
</div>
<div class="row">
<h3>ADD YOUR CUSTOM ORDER</h3>
<form>
<div class="form-group">
<textarea name="custom-order" [(ngModel)]="customeOrder" rows="5"></textarea>
</div>
<div class="form-group pull-right">
<button class="btn btn-primary" (click)="clear()">CLEAR</button>
<button class="btn btn-primary" (click)="addCustomOrder()">ADD TO CART</button>
</div>
</form>
</div>
</div>

<modal #cartModal class="modal_vcenter">
Expand Down Expand Up @@ -55,5 +67,4 @@ <h3> {{selectedItem.Price}} </h3>
</form>
<button class="btn btn-primary" (click)="addToCart()">ADD TO CART</button>
</modal-footer>

</modal>
18 changes: 11 additions & 7 deletions app/vendor-menu/vendor-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { OrderCart } from '.././shared/model/order-cart';
export class VendorMenuComponent implements OnInit {
vendor: any;
selectedItem : PackageListModel;
customeOrder: string = "";

orderCart: OrderModel;

Expand All @@ -35,6 +36,15 @@ export class VendorMenuComponent implements OnInit {
}


addCustomOrder(){
if(this.customeOrder){
this.orderCart.Description = this.customeOrder;
}
}

clear(){
this.customeOrder = "";
}

@ViewChild('cartModal')
cartModal: ModalComponent;
Expand All @@ -51,9 +61,6 @@ export class VendorMenuComponent implements OnInit {
this.selectedItem.Item = item.item;
this.selectedItem.Price = item.price;
this.selectedItem.Quantity = 1;

console.log(this.orderCart.OrderCart.PackageList);

}

addMore(){
Expand All @@ -78,12 +85,9 @@ export class VendorMenuComponent implements OnInit {

addToCart(){
this.orderCart.OrderCart.PackageList.push(this.selectedItem);
this.closeCartModal();
this.selectedItem = new PackageListModel();
this.closeCartModal();
}





}

0 comments on commit 809a237

Please sign in to comment.