#LOOP(#AppLinks.links)
#IF(#rel EQ "installApp")
#SET("install_link",#href)
#ENDIF
#IF(#rel EQ "uninstallApp")
#SET("uninstall_link",#href)
#ENDIF
#IF(#rel EQ "removeApp")
#IF(#App.terminated)
#SET("uninstall_link_terminated_app",#href)
#ELSE
#SET("uninstall_link_blocked_app",#href)
#ENDIF
#ENDIF
#IF(#rel EQ "openApp")
#SET("open_link",#href)
#ENDIF
#IF(#rel EQ "installTheme")
#SET("install_theme_link",#href)
#ENDIF
#ENDLOOP
#IF(#install_link)
#LOOP(#FROMPLAINLOOP(#App.scopes))
#IF(#Element EQ "products_read") #SET("Scope",#Scope."products_read,") #ENDIF
#IF(#Element EQ "products_read_batch") #SET("Scope",#Scope."products_read_batch,") #ENDIF
#IF(#Element EQ "products_write") #SET("Scope",#Scope."products_write,") #ENDIF
#IF(#Element EQ "carts_read") #SET("Scope",#Scope."carts_read,") #ENDIF
#IF(#Element EQ "carts_write") #SET("Scope",#Scope."carts_write,") #ENDIF
#IF(#Element EQ "carts_price_write") #SET("Scope",#Scope."carts_price_write,") #ENDIF
#IF(#Element EQ "orders_read") #SET("Scope",#Scope."orders_read,") #ENDIF
#IF(#Element EQ "orders_write") #SET("Scope",#Scope."orders_write,") #ENDIF
#IF(#Element EQ "customers_read") #SET("Scope",#Scope."customers_read,") #ENDIF
#IF(#Element EQ "customers_write") #SET("Scope",#Scope."customers_write,") #ENDIF
#IF(#Element EQ "legal_read") #SET("Scope",#Scope."legal_read,") #ENDIF
#IF(#Element EQ "legal_write") #SET("Scope",#Scope."legal_write,") #ENDIF
#IF(#Element EQ "newsletters_read") #SET("Scope",#Scope."newsletters_read,") #ENDIF
#IF(#Element EQ "newsletters_write") #SET("Scope",#Scope."newsletters_write,") #ENDIF
#IF(#Element EQ "coupons_read") #SET("Scope",#Scope."coupons_read,") #ENDIF
#IF(#Element EQ "coupons_write") #SET("Scope",#Scope."coupons_write,") #ENDIF
#IF(#Element EQ "scripttags_read") #SET("Scope",#Scope."scripttags_read,") #ENDIF
#IF(#Element EQ "scripttags_write") #SET("Scope",#Scope."scripttags_write,") #ENDIF
#ENDLOOP
#ENDIF
#IF(#install_theme_link)
#IF(#App.price EQ "free")
#ELSE
#ENDIF
#ENDIF
#IF(#open_link)
#ENDIF
#IF(#uninstall_link_terminated_app)
#ENDIF