Commit f363a9ee authored by pborate's avatar pborate

Updated ecm-cart.component.html, ecm-cart.component.ts, ecm-cart.service.ts.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@175956 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1c4f9bb5
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
<div class="large-6 columns ecm-item-info"> <div class="large-6 columns ecm-item-info">
<span style="display: block;font-size: 16px;"> {{item.itemHeader.itemDescr}} </span> <span style="display: block;font-size: 16px;"> {{item.itemHeader.itemDescr}} </span>
<span style="display: block;font-size: 16px;"> {{item.itemHeader.itemShDescr}} </span>
<span class="item-shdescr" > <span class="item-shdescr" >
{{item.itemHeader.itemShDescr}} {{item.itemHeader.itemShDescr}}
</span> </span>
......
...@@ -76,7 +76,7 @@ export class EcmCartComponent implements OnInit, AfterViewChecked { ...@@ -76,7 +76,7 @@ export class EcmCartComponent implements OnInit, AfterViewChecked {
userActionUrl = '/ecm/service/feeds/cart'; userActionUrl = '/ecm/service/feeds/cart';
deleteCartItem( item ) { deleteCartItem( item ) {
console.log( "deleteCartItem Called" ); console.log( "deleteCartItem Called",item );
this.store.dispatch(this.cartAction.deleteCartItem(item)); this.store.dispatch(this.cartAction.deleteCartItem(item));
...@@ -97,6 +97,7 @@ export class EcmCartComponent implements OnInit, AfterViewChecked { ...@@ -97,6 +97,7 @@ export class EcmCartComponent implements OnInit, AfterViewChecked {
cartData.itemQuantity = item.itemQuantity; cartData.itemQuantity = item.itemQuantity;
this.store.dispatch(this.cartAction.updateCart(cartData)); this.store.dispatch(this.cartAction.updateCart(cartData));
this.getCartItem();
this.openSnackBar( 'Quantity increased of ' + item.itemHeader.itemShDescr ); this.openSnackBar( 'Quantity increased of ' + item.itemHeader.itemShDescr );
} }
...@@ -106,6 +107,7 @@ export class EcmCartComponent implements OnInit, AfterViewChecked { ...@@ -106,6 +107,7 @@ export class EcmCartComponent implements OnInit, AfterViewChecked {
cartData.itemCode = item.itemCode; cartData.itemCode = item.itemCode;
cartData.itemQuantity = item.itemQuantity; cartData.itemQuantity = item.itemQuantity;
this.store.dispatch(this.cartAction.updateCart(cartData)); this.store.dispatch(this.cartAction.updateCart(cartData));
this.getCartItem();
this.openSnackBar( 'Quantity decreased of ' + item.itemHeader.itemShDescr ); this.openSnackBar( 'Quantity decreased of ' + item.itemHeader.itemShDescr );
} }
...@@ -122,6 +124,7 @@ export class EcmCartComponent implements OnInit, AfterViewChecked { ...@@ -122,6 +124,7 @@ export class EcmCartComponent implements OnInit, AfterViewChecked {
{ {
this.store.dispatch(this.cartAction.deleteCartItem(item)); this.store.dispatch(this.cartAction.deleteCartItem(item));
this.store.dispatch(this.wishListAction.addToWishlistSuccess(item)); this.store.dispatch(this.wishListAction.addToWishlistSuccess(item));
this.getCartItem();
this.openSnackBar('Item Added to your Wishlist'); this.openSnackBar('Item Added to your Wishlist');
} }
else else
...@@ -137,7 +140,7 @@ export class EcmCartComponent implements OnInit, AfterViewChecked { ...@@ -137,7 +140,7 @@ export class EcmCartComponent implements OnInit, AfterViewChecked {
} }
confirmDialog( item: any ) { confirmDialog( item: any ) {
this.cartService.setItemCode( item.itemCode ); this.cartService.setItemCode( item.itemCode.trim() );
let dialogRef = this.dialog.open( ECMConfirmDialog,{ let dialogRef = this.dialog.open( ECMConfirmDialog,{
width:'300px', width:'300px',
height:'180px', height:'180px',
......
...@@ -67,10 +67,11 @@ export class EcmCartService { ...@@ -67,10 +67,11 @@ export class EcmCartService {
} }
deleteCartItem( item ) { deleteCartItem( item ) {
console.log( "deleteCartItem Called" ); let itemCode=item.itemCode.trim();
console.log( "deleteCartItem Called item code ["+itemCode+"]" );
let siteCode = localStorage.getItem('SITE_CODE'); let siteCode = localStorage.getItem('SITE_CODE');
return this.http.delete( this.hostUrlService.hostUrl+this.userActionUrl + '/' + siteCode + '/cart' + '/' + item.itemCode, {}) return this.http.delete( this.hostUrlService.hostUrl+this.userActionUrl + '/' + siteCode + '/cart' + '/' + itemCode, {})
.map(res => res.json()); .map(res => res.json());
} }
...@@ -153,6 +154,6 @@ export class EcmCartService { ...@@ -153,6 +154,6 @@ export class EcmCartService {
setItemCode(itemCode) { setItemCode(itemCode) {
this.itemCode = itemCode; this.itemCode = itemCode;
console.log("setItems"+this.itemCode); console.log("setItems ["+this.itemCode+"]");
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment