@@ -4353,17 +4353,33 @@ public ActionResult AssociateProductToAttributeValuePopup(string productIdInput,
43534353 return View ( model ) ;
43544354 }
43554355
4356- //action displaying notification (warning) to a store owner that associated product has attributes
4356+ //action displaying notification (warning) to a store owner when associating some product
43574357 [ ValidateInput ( false ) ]
4358- public ActionResult AssociatedProductHasAttributes ( int productId )
4358+ public ActionResult AssociatedProductGetWarnings ( int productId )
43594359 {
43604360 var associatedProduct = _productService . GetProductById ( productId ) ;
4361- if ( associatedProduct != null && associatedProduct . ProductAttributeMappings . Any ( ) )
4361+ if ( associatedProduct != null )
43624362 {
4363- if ( associatedProduct . ProductAttributeMappings . Any ( attribute => attribute . IsRequired ) )
4364- return Json ( new { Result = _localizationService . GetResource ( "Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.HasRequiredAttributes" ) } , JsonRequestBehavior . AllowGet ) ;
4363+ //attributes
4364+ if ( associatedProduct . ProductAttributeMappings . Any ( ) )
4365+ {
4366+ if ( associatedProduct . ProductAttributeMappings . Any ( attribute => attribute . IsRequired ) )
4367+ return Json ( new { Result = _localizationService . GetResource ( "Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.HasRequiredAttributes" ) } , JsonRequestBehavior . AllowGet ) ;
43654368
4366- return Json ( new { Result = _localizationService . GetResource ( "Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.HasAttributes" ) } , JsonRequestBehavior . AllowGet ) ;
4369+ return Json ( new { Result = _localizationService . GetResource ( "Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.HasAttributes" ) } , JsonRequestBehavior . AllowGet ) ;
4370+ }
4371+
4372+ //gift card
4373+ if ( associatedProduct . IsGiftCard )
4374+ {
4375+ return Json ( new { Result = _localizationService . GetResource ( "Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.GiftCard" ) } , JsonRequestBehavior . AllowGet ) ;
4376+ }
4377+
4378+ //downloaable product
4379+ if ( associatedProduct . IsDownload )
4380+ {
4381+ return Json ( new { Result = _localizationService . GetResource ( "Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.Downloadable" ) } , JsonRequestBehavior . AllowGet ) ;
4382+ }
43674383 }
43684384
43694385 return Json ( new { Result = string . Empty } , JsonRequestBehavior . AllowGet ) ;
0 commit comments