#SET("PREDEFCOUNT",0)
#LOOP(#UserDefinedAttributes)
#IF(#DEFINED(#PREDEFCOUNT) AND #DEFINED(#Type) AND (#Type EQ "PreDefString" OR #Type EQ "PreDefLocalizedString"))
#SET("PREDEFCOUNT",#PREDEFCOUNT +1)
#ENDIF
#ENDLOOP
#IF(#DELETE)
{AcceptAction1}
{AcceptAction2}
#LOOP(#DeleteObjects)
#ENDLOOP
#ELSE
#IF(#COUNT(#UserDefinedAttributes) NGE #Shop.FeatureMaxValue.ProductTypeAttributes)
{Notification}
{FeatureMaxValueReached}
{FeatureMaxValueProductTypeAttributes} #Shop.FeatureMaxValue.ProductTypeAttributes
#INCLUDE("FeaturePromotion")
#ENDIF
#IF(#FormError)
#IF(#FormErrors.Reason.FeatureLimitExceeded)
{Notification}
{CouldNotCreateObject}
{FeatureMaxValueProductTypeAttributes} #Shop.FeatureMaxValue.ProductTypeAttributes
#INCLUDE("FeaturePromotion")
#ENDIF
#IF(#FormErrors.Reason.VariationFeatureMaxValueReached)
{Notification}
{CouldNotCreateObjectVariations}
{FeatureMaxValueVariations} #Shop.FeatureMaxValue.Variations
#INCLUDE("FeaturePromotion")
#ELSIF(#DEFINED(#PREDEFCOUNT))
#IF(#PREDEFCOUNT NGE #Shop.FeatureMaxValue.Variations)
{Notification}
{VariationFeatureMaxValueReached}
{FeatureMaxValueVariations} #Shop.FeatureMaxValue.Variations
#INCLUDE("FeaturePromotion")
#ELSIF(#FormErrors.Reason.ProductsWithThisVariationAttributeExist)
{InputError}
{ProductsWithThisVariationAttributeExist}
#ENDIF
#ENDIF
#ENDIF
#ENDIF
#IF(NOT #DELETE)
#SNIPPET("INC-BatchActions", "BatchActions", "BatchActions")
#IF(#FormError AND (FormError_Alias OR #FormError_Name OR #FormError_Position OR #FormError_TypePackage) AND NOT #FormErrors.Reason.ProductsWithThisVariationAttributeExist AND NOT #FormErrors.Reason.FeatureLimitExceeded AND NOT #FormErrors.Reason.VariationFeatureMaxValueReached)
#ENDIF
#ENDIF
#IF(#DELETE)
#ELSE
#ENDIF
#ENDBLOCK