Commit 5f00b604 authored by pborate's avatar pborate

Updated ecm-product-detail.component.ts

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174918 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 20950498
......@@ -19,6 +19,7 @@ import { EcmFoodComponent } from './ecm-template/ecm-food.component';
import { EcmCelebrationComponent } from './ecm-template/ecm-celebration.component';
import { EcmHandicraftComponent } from './ecm-template/ecm-handicraft.component';
import { EcmTrainingComponent } from './ecm-template/ecm-training.component';
import { EcmGeneralComponent } from './ecm-template/ecm-general.component';
import { EcmProductReviewComponent } from './ecm-product-review.component';
import { EcmRelatedItemsComponent } from '../ecm-view/ecm-related-items/ecm-related-items.component';
import { ECMCart } from '../ecm-model/cart-model';
......@@ -36,7 +37,8 @@ export const ECM_TEMPLATES: any = {
'ecm-food' : new EcmTemplateItem(EcmFoodComponent),
'ecm-celebration' : new EcmTemplateItem(EcmCelebrationComponent),
'ecm-handicraft' : new EcmTemplateItem(EcmHandicraftComponent),
'ecm-training' : new EcmTemplateItem(EcmTrainingComponent)
'ecm-training' : new EcmTemplateItem(EcmTrainingComponent),
'ecm-general' : new EcmTemplateItem(EcmGeneralComponent)
};
@Component({
......@@ -103,17 +105,33 @@ export class EcmProductDetailsComponent implements OnInit {
this.storeCatSubcat();
let ecmTemplateName = this.itemDetail.itemCategory.ecmTemplate;
console.log( "getItemDetail ecmTemplateName: " + ecmTemplateName )
this.ecmTemplate = ECM_TEMPLATES[ecmTemplateName];
this.scatCode = this.itemDetail.itemSubCategory.scatCode;
this.noOfReviews = this.itemDetail.itemRatings.NO_OF_REVIEWS;
if(ecmTemplateName==null)
{
this.ecmTemplate = ECM_TEMPLATES['ecm-general'];
console.log( "Sorry, the " + ecmTemplateName + " is not in the system yet!" );
console.log('--ecmTemplate---',this.ecmTemplate);
}
else{
console.log( "ecmTemplate " + ecmTemplateName + " in else" );
this.ecmTemplate = ECM_TEMPLATES[ecmTemplateName];
}
this.ecmTemplate.setItemDetail( this.itemDetail );
if(this.itemDetail.itemSubCategory){
this.scatCode = this.itemDetail.itemSubCategory.scatCode;
}
this.noOfReviews = this.itemDetail.itemRatings.NO_OF_REVIEWS;
let breadcrumb = [{label: 'Home', url: '/home'}, {label: this.itemDetail.itemCategory.shDescr,url: '/categories/' + this.itemDetail.itemSubCategory.catCode},{label: this.itemDetail.itemSubCategory.shDescr,url: '/products/' + this.itemDetail.itemSubCategory.scatCode}];
this.breadcrumbSerivce.breadcrumbs = breadcrumb;
console.log( "Changed scatCode.." + this.scatCode );
let breadcrumb = [{label: 'Home', url: '/home'}, {label: this.itemDetail.itemCategory.shDescr,url: '/categories/' + this.itemDetail.itemSubCategory.catCode},{label: this.itemDetail.itemSubCategory.shDescr,url: '/products/' + this.itemDetail.itemSubCategory.scatCode}];
this.breadcrumbSerivce.breadcrumbs = breadcrumb;
console.log( "Changed scatCode.." + this.scatCode );
if ( this.ecmTemplate ) {
this.ecmTemplate.setItemDetail( this.itemDetail );
console.log('template----',this.ecmTemplate);
// this.ecmTemplate.setItemDetail( this.itemDetail );
}
else {
//alert( "Sorry, the " + ecmTemplateName + " is not in the system yet!" );
......
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