Beispiel #1
0
        // GET: DigitalCameraSkuContent
        public ActionResult Index(DigitalCameraVariationContent currentContent)
        {
            if (currentContent == null)
            {
                throw new ArgumentNullException("currentContent");
            }

            DigitalCameraVariationViewModel viewModel = new DigitalCameraVariationViewModel(currentContent);

            viewModel.PriceViewModel        = GetPriceModel(currentContent);
            viewModel.AllVariationSameStyle = CreateRelatedVariationViewModelCollection(currentContent, Constants.AssociationTypes.SameStyle);
            if (viewModel.RelatedProductsContentArea == null)
            {
                viewModel.RelatedProductsContentArea = CreateRelatedProductsContentArea(currentContent, Constants.AssociationTypes.Default);
            }
            TrackAnalytics(viewModel);

            viewModel.IsSellable = IsSellable(currentContent);
            return(View(viewModel));
        }
Beispiel #2
0
        // GET: DigitalCameraSkuContent
        public ActionResult Index(DigitalCameraVariationContent currentContent)
        {
            if (currentContent == null)
            {
                throw new ArgumentNullException("currentContent");
            }

            DigitalCameraVariationViewModel viewModel = new DigitalCameraVariationViewModel(currentContent);

            viewModel.PriceViewModel        = currentContent.GetPriceModel();
            viewModel.AllVariationSameStyle = CreateRelatedVariationViewModelCollection(currentContent, Constants.AssociationTypes.SameStyle);

            var result = _recommendationService.GetRecommendationsForProductPage(currentContent.Code, HttpContext, currentContent);

            viewModel.ProductCrossSell    = CreateProductListViewModels(result, "productCrossSellsWidget", 6);
            viewModel.ProductAlternatives = CreateProductListViewModels(result, "productAlternativesWidget", 3);

            TrackAnalytics(viewModel);

            viewModel.IsSellable = IsSellable(currentContent);
            return(View(viewModel));
        }
Beispiel #3
0
        protected void TrackAnalytics(DigitalCameraVariationViewModel viewModel)
        {
            // Track
            GoogleAnalyticsTracking tracking = new GoogleAnalyticsTracking(ControllerContext.HttpContext);

            tracking.ClearInteractions();

            // Track the main product view
            tracking.ProductAdd(
                viewModel.CatalogVariationContent.Code,
                viewModel.CatalogVariationContent.DisplayName,
                null,
                viewModel.CatalogVariationContent.Facet_Brand,
                null, null, 0,
                (double)viewModel.CatalogVariationContent.GetDefaultPriceAmount(_currentMarket.GetCurrentMarket()),
                0
                );

            // TODO: Track related products as impressions

            // Track action as details view
            tracking.Action("detail");
        }