getAllowedLocales()
:
List
Returns the allowed locales of the current site as a collection of locale ID's.
static getCalendar()
:
Calendar
Returns a new Calendar object in the time zone of the current site.
getPageMetaTags()
:
Array
Returns all page meta tags, defined for this instance for which content can be generated.
getTimezone()
:
String
Returns the code for the time zone in which the storefront is running.
isOMSEnabled()
:
boolean
Whether oms is active in the current site.
getAllowedCurrencies
getAllowedCurrencies()
:
List
Returns the allowed currencies of the current site as a collection of
currency codes.
Returns:
Collection of allowed site currencies
getAllowedLocales
getAllowedLocales()
:
List
Returns the allowed locales of the current site as a collection of
locale ID's.
Returns:
Collection if allowed site locales
getAllSites
static
getAllSites()
:
List
Returns all sites.
Returns:
all sites for the current instance
getCalendar
Returns a new Calendar object in the time zone of the
current site.
Returns:
the Calendar object in the time zone of the current site.
getCurrencyCode
Returns the default currency code for the current site.
Returns:
the default currency code for the current site.
getCurrent
static
getCurrent()
:
Site
Returns the current site.
Returns:
the current site.
getCustomPreferenceValue
Returns a custom preference value. If the preference does not exist the
method returns null. This method is simply a shortcut method for
accessing the value for a custom attribute defined on the
SitePreferences object.
// Method #1
var mySitePrefValue1 : String = dw.system.Site.getCurrent().
getCustomPreferenceValue("mySitePref");
// Method #2
var sitePrefs : SitePreferences = dw.system.Site.getCurrent().getPreferences();
var mySitePrefValue2 : String = sitePrefs.getCustom()["mySitePref"];
Parameters:
name
-
preference name.
Returns:
the preference value, or null if there is no preference with the given name.
getDefaultCurrency
Returns the default currency code for the current site.
Returns:
the default currency code for the current site.
getDefaultLocale
Return default locale for the site.
Returns:
default locale for the site.
getEinsteinSiteID
Returns the Einstein site Id. Typically this is a concatenation of the realm, underscore character and the site id.
It can be overwritten by support users to help with realm moves to continue using the Einstein data from the old realm.
Used when making calls to the Einstein APIs.
Returns:
the Einstein site Id
getHttpHostName
Returns the configured HTTP host name. If no host name
is configured the method returns the instance hostname.
Returns:
the configured HTTP host name or if it is not set the instance hostname.
getHttpsHostName
Returns the configured HTTPS host name. If no host name
is configured the method returns the HTTP host name or the instance hostname, if
that is not configured as well.
Returns:
the configured HTTPS host name or HTTP host name or the instance hostname.
getID
Returns the ID of the site.
Returns:
the ID of the site.
getName
Returns a descriptive name for the site.
Returns:
a descriptive name for the site.
getPageMetaTag
Returns the page meta tag for the specified id.
The meta tag content is generated based on the home page meta tag context and rule.
The rule is obtained from the current repository domain.
Null will be returned if the meta tag is undefined on the current instance, or if no rule can be found for the
current context, or if the rule resolves to an empty string.
Parameters:
id
-
the ID to get the page meta tag for
Returns:
page meta tag containing content generated based on rules
getPageMetaTags
getPageMetaTags()
:
Array
Returns all page meta tags, defined for this instance for which content can be generated.
The meta tag content is generated based on the home page meta tag context and rules.
The rules are obtained from the current repository domain.
Returns:
page meta tags defined for this instance, containing content generated based on rules
getPreferences
This method returns a container of all site preferences of this site.
Returns:
a preferences object containing all system and custom site preferences of this site
getStatus
Returns:
Status of the this site.
getTimezone
Returns the code for the time zone in which the storefront is
running.
Returns:
time zone code in which the storefront is running.
getTimezoneOffset
Returns time zone offset in which the storefront is running.
Returns:
time zone offset in which the storefront is running.
isOMSEnabled
isOMSEnabled()
:
boolean
Whether oms is active in the current site. This depends on a general
property which states whether oms is active for the server,
and a site-dependent preference whether oms is available for the current site.
Deprecated:
This item is deprecated.
Returns:
whether oms is active in the site
setCustomPreferenceValue
setCustomPreferenceValue(name
:
String, value
:
Object)
:
void
The method sets a value for a custom preference. The type of the value
must match with the declared type of the preference definition.
Parameters:
name
-
name of the preference
value
-
new value for the preference