public FeedGoogleShoppingModel() { AvailableCurrencies = new List <SelectListItem>(); AvailableGoogleCategories = new List <SelectListItem>(); GeneratedFiles = new List <GeneratedFileModel>(); GoogleProductSearchModel = new GoogleProductSearchModel(); }
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)); }
public GoogleProductModel() { GoogleProductListSearchModel = new GoogleProductSearchModel(); }