public FeedGoogleShoppingModel()
 {
     AvailableCurrencies       = new List <SelectListItem>();
     AvailableGoogleCategories = new List <SelectListItem>();
     GeneratedFiles            = new List <GeneratedFileModel>();
     GoogleProductSearchModel  = new GoogleProductSearchModel();
 }
Beispiel #2
0
        public IActionResult GoogleProductList(GoogleProductSearchModel searchModel)
        {
            var storeId  = _storeContext.ActiveStoreScopeConfiguration;
            var products = _productService.SearchProducts(
                storeId: storeId,
                pageIndex: searchModel.Page - 1,
                pageSize: searchModel.PageSize,
                showHidden: true);

            //prepare list model
            var model = new GoogleProductListModel().PrepareToGrid(searchModel, products, () =>
            {
                return(products.Select(product =>
                {
                    var gModel = new GoogleProductModel
                    {
                        ProductId = product.Id,
                        ProductName = product.Name
                    };
                    var googleProduct = _googleService.GetByProductId(product.Id);
                    if (googleProduct != null)
                    {
                        gModel.GoogleCategory = googleProduct.Taxonomy;
                        gModel.Gender = googleProduct.Gender;
                        gModel.AgeGroup = googleProduct.AgeGroup;
                        gModel.Color = googleProduct.Color;
                        gModel.GoogleSize = googleProduct.Size;
                        gModel.CustomGoods = googleProduct.CustomGoods;
                    }
                    return gModel;
                }));
            });

            return(Json(model));
        }
Beispiel #3
0
 public GoogleProductModel()
 {
     GoogleProductListSearchModel = new GoogleProductSearchModel();
 }