#LOCAL("CombinationNotAvailable", 0)
#IF(#FormError AND NOT #FormErrors.Form.Login.ErrorCount)
#LOOP(#FormErrors.Reasons)
#IF(#Reason EQ "SUBPRODUCT_NOT_EXISTS")
#SET("CombinationNotAvailable", 1)
#ENDIF
#ENDLOOP
#ENDIF
#IF(#INPUT.ViewAction NE "ViewProductPrint" AND #INPUT.ViewAction NE "ViewPrint")
#IF(#IsAppointment)
#IF(#IsVisible)
#IF(#DEFINED(#Shop.MakeAppointmentLinkText))#Shop.MakeAppointmentLinkText#ELSE {MakeAppointmentLink}#ENDIF
#ENDIF
#ELSIF(#HASPRICE(#Object, #INPUT.Currency, #Session.User.Object))
#REM#ENDREM
#IF(#Shop.FeatureMaxValue.Basket AND #CombinationNotAvailable NEQ 0 AND #CanAddToBasket AND NOT #TemplateNoAddToBasket)
#LOCAL("PagerSetting",#PagerSettings)#IF(NOT #DEFINED(#PagerSettings))#SET("PagerSettings","")#ENDIF
#LOCAL("LinkOption",#LinkOption)#IF(NOT #DEFINED(#LinkOption))#SET("LinkOption","Text")#ENDIF
#LOCAL("Add2BasketLinkVersion", "AddToBasket")
#IF(NOT #Session.User OR #Session.User.IsAnonymous)
#IF(#Shop.LoginRequired2Order)
#SET("Add2BasketLinkVersion", "RegistrationLink")
#ENDIF
#ELSE
#LOCAL("Customer", #FUNCTION("GetCustomerForUserID", #Session.User.ID, #Shop.ID))
#IF(NOT #Customer)
#IF(#Shop.LoginRequired2Order)
#SET("Add2BasketLinkVersion", "RegistrationLink")
#ENDIF
#ELSIF(NOT #Customer.IsDoOrderAllowed)
#SET("Add2BasketLinkVersion", "NotAllowForCustomer")
#ENDIF
#ENDLOCAL
#ENDIF
#IF(#LinkOption EQ "Text")
#ENDIF
#IF(#Add2BasketLinkVersion EQ "RegistrationLink") #REM #ENDREM
{AddToBasketNotAllowedForUnregistered}
{RegisterNow}
#IF(#LinkOption EQ "Text")
{AddToBasket}
#ELSE
#ENDIF
#IF(#LinkOption EQ "Text")
#ENDIF
#ELSIF(#Add2BasketLinkVersion EQ "NotAllowForCustomer") #REM #ENDREM
{AddToBasketNotAllowedForAccount}
#IF(#LinkOption EQ "Text")
{AddToBasket}
#ELSE
#ENDIF
#IF(#LinkOption EQ "Text")
#ENDIF
#ELSE #REM #ENDREM