#REM Parameters: #SNIPPET.Head ... Title/label for input field #SNIPPET.AddressPrefix ... Prefix for the current address (BillingAddress_, ShippingAddress_ ...) #SNIPPET.RegistrationSet ... Alias of the registration set (BillingAddress, ShippingAddress) #SNIPPET.ToggleBox ... ID for the Element that should be toggled #SNIPPET.ShowShippingAddress ... Flag if ShippingAddress should be displayed (1) or not (0) Example: #SNIPPET("SNIPPET-EditCustomerAddresses", "AddressPrefix, Head, ToggleBox, ShowShippingAddress", "BillingAddress_", "{BillingAddress}", "ep-customer-shippingaddress", 1) #ENDREM #LOCAL("AddressPrefix", #SNIPPET.AddressPrefix) #LOCAL("IsFieldMandatory", 0)
#REM #ENDREM
#REM #ENDREM

#SNIPPET.Head

#REM #ENDREM
#REM #ENDREM
#LOOP(#Shop.UnityRegistrationSet) #IF(#GET("Is".#SNIPPET.RegistrationSet."Visible")) #LOCAL("HasFormError", #DEFINED(#KEY(#FormErrors.Error, #AddressPrefix . #Attribute.Alias))) #IF(#GET("Is".#SNIPPET.RegistrationSet."Mandatory")) #SET("IsFieldMandatory", 1) #ELSE #SET("IsFieldMandatory", 0)#ENDIF #IF(#Attribute.Alias EQ "CountryID")
#REM #ENDREM #SET("HasFormError", #DEFINED(#KEY(#FormErrors.Error, #AddressPrefix . "State")))
#REM #ENDREM #ELSIF(#ZipCodeAndCity AND #Attribute.Alias EQ "Zipcode")
#SET("HasFormError", #DEFINED(#KEY(#FormErrors.Error, #AddressPrefix . "City"))) #IF(#GET("Shop.RegistrationField.City.Is".#SNIPPET.RegistrationSet."Mandatory")) #SET("IsFieldMandatory", 1) #ELSE #SET("IsFieldMandatory", 0)#ENDIF
#REM #ENDREM #ELSIF(#Attribute.Alias EQ "Gender")
#REM #ENDREM
#REM #ENDREM
#REM #ENDREM #ELSIF(#Attribute.Alias EQ "Birthday")
#ELSIF(#Attribute.Alias NE "State" AND NOT (#Attribute.Alias EQ "City" AND #ZipCodeAndCity)) #LOCAL("AttributeValue", #GET(#Attribute.Alias))
#LOCAL("ValidateOptions", "") #IF(#IsFieldMandatory) #SET("ValidateOptions", "required: true") #ENDIF #IF("EMail" IN #Attribute.Alias) #SET("ValidateOptions", #ValidateOptions.",type: 'email'") #ENDIF #LOCAL("MaxValue", #GET("FormFields." . #SNIPPET.RegistrationSet . "_" . #Attribute.Alias . ".MaxValue")) #IF(#DEFINED(#MaxValue)) #SET("ValidateOptions", #ValidateOptions.",maxlength: ".#MaxValue) #ENDIF #ENDLOCAL #ENDLOCAL
#REM #ENDREM #ENDLOCAL #ENDIF #ENDLOCAL #ENDIF #ENDLOOP
#REM #ENDREM
#IF(#DEFINED(#SNIPPET.ToggleBox))
#REM #ENDREM #ENDIF
#REM #ENDREM #ENDLOCAL #REM IsFieldMandatory #ENDREM #ENDLOCAL #REM AddressPrefix #ENDREM