Package DE_EPAGES::Shop::API::Object::Shop
object interface for Shop.
Base |
DE_EPAGES::Object::API::Object::Site |
Functions
- activateCurrency
- activeLocaleByLanguage
- addCountry
- addCurrency
- addLanguage
- addRegion
- backofficeLocales
- businessHours
- className
- countries
- currencies
- dbPackage
- deactivateCurrency
- defaultCountry
- existsCountry
- existsCurrency
- existsLanguage
- existsRegion
- existsSiteLocale
- exportXMLChildElements
- exportableChildren
- featureCurrentValue
- featureIncrementValue
- featureIsDirty
- featureIsVisible
- featureMaxValue
- featureTestValue
- features
- formatter
- infoCountry
- isCurrencyActive
- isTemporaryClosed
- languages
- localeByLanguage
- regions
- removeCountry
- removeCurrency
- removeLanguage
- removeRegion
- updateCountry
- updateCurrency
- updateSiteLocale
activateCurrency
Sets a currency active in the storefront.
Syntax |
$Shop->activateCurrency($CurrencyID); |
Input |
|
activeLocaleByLanguage
Returns the first ACTIVE locale for a given language, sorted by position.
Syntax |
$LocaleID = $Shop->localeByLanguage($LanguageID); |
Return |
|
addCountry
Adds a Country to the shop.
Syntax |
$Shop->addCountry($CountryID,$Position,$IsDefault); |
Example |
$Shop->addCountry(4,10,1); |
Input |
|
addCurrency
Adds a currency to the shop.
Syntax |
$Shop->addCurrency($CurrencyID); |
Example |
$Shop->addCurrency('EUR'); |
Input |
|
addLanguage
Adds a Language to the shop. If the shop has only one storefront language (feature Langauges=1), then the current language is removed before the new language is added. In this case also the default locale is changed.
Syntax |
$Shop->addLanguage($LanguageID); |
Example |
$Shop->addLanguage(32); |
Input |
|
Return |
|
addRegion
Adds a region to the shop.
Syntax |
$Shop->addRegion($Alias); |
Example |
$Shop->addRegion('EU-Countries'); |
Input |
|
Return |
|
backofficeLocales
Returns all locales that can be used in the back-office of the shop.
Syntax |
$aLocales = $Shop->backofficeLocales; |
Return |
|
businessHours
Returns shop calendar (child BusinessHours), if not exists then the calendar will be created.
Syntax |
$Calendar = $Shop->businessHours; |
Return |
|
className
Returns the class name, used for DAL access.
Syntax |
$ClassName = $Shop->className; |
Return |
|
countries
Returns all countries that are assigned to the shop.
Syntax |
$aCountryID = $Shop->countries; |
Return |
|
currencies
Returns all currencies that are assigned to the shop.
Syntax |
$aCurrencyID = $Shop->currencies; |
Return |
|
dbPackage
Returns the database package, used for DAL access.
Syntax |
$DbPackage = $Shop->dbPackage; |
Return |
|
deactivateCurrency
Sets a currency inactive in the storefront.
Syntax |
$Shop->deactivateCurrency($CurrencyID); |
Input |
|
defaultCountry
Return id of default country of the shop.
Syntax |
$Shop->defaultCountry(); |
Return |
|
existsCountry
Asks if a Country exists for the shop.
Syntax |
$Shop->existsCountry($CountryID); |
Input |
|
existsCurrency
Asks if a currency exists in the shop.
Syntax |
$Shop->existsCurrency($CurrencyID); |
Input |
|
existsLanguage
Asks if a Language exists for the shop.
Syntax |
$Exists = $Shop->existsLanguage($LanguageID); |
Input |
|
Return |
|
existsRegion
Asks if a Region exists for the shop.
Syntax |
$Shop->existsRegion($Alias); |
Input |
|
existsSiteLocale
Returns true if the site supports the given locale. Returns false if the shop does not support the languageof the locale, because the number of languages per shop is restricted by a feature.
Syntax |
$Exists = $Site->existsSiteLocale($LocaleID); |
Example |
if( $Site->existsSiteLocale('en_GB') ) { ... } |
Input |
|
Return |
|
exportXMLChildElements
Add xml elements for children (asks each with planXMLExport to add to driver).
Syntax |
$Object->exportXMLChildElements( $Driver, $hAttributes ); |
Input |
|
exportableChildren
Don't export the folder "Languages".
Syntax |
$aChildren = $Object->exportableChildren |
Return |
|
featureCurrentValue
Returns or sets the currently used value of a shop feature. The function also checks if the new value is larger than the previous value and larger than the limit of featureMaxValue for this shop. The error FeatureLimitExceeded is thrown if $NewValue > featureMaxValue && $NewValue > featureCurrentValue.
Syntax |
$CurrentValue = $Shop->featureCurrentValue( $Feature ); $Shop->featureCurrentValue( $Feature, $NewValue ); $Shop->featureCurrentValue( $Feature, $NewValue, $AllowToExceed ); |
Example |
if( $Shop->featureCurrentValue( $FeatureProducts ) < $MaxValue ) { ... }; my $CountProducts = CountShopProducts( $Shop ); $Shop->featureCurrentValue( $FeatureProducts, $CountProducts ); |
Input |
|
Return |
|
featureIncrementValue
Increments or decrements the currently value of a shop feature. The function also checks if the new value is larger than the previous value and larger than the limit of featureMaxValue for this shop. The error FeatureLimitExceeded is thrown if $NewValue > featureMaxValue && $NewValue > featureCurrentValue.
Syntax |
$CurrentValue = $Shop->featureIncrementValue( $FeatureName, $IncValue ); $CurrentValue = $Shop->featureIncrementValue( $Feature, $IncValue ); |
Example |
$Shop->featureIncrementValue('Products', 1); # on insert product $Shop->featureIncrementValue('Products', -1); # on delete product |
Input |
|
Return |
|
featureIsDirty
Returns or sets the IsDirty flag for a feature. If this flag is true, then the current value of the feature may not be corrent and should be updated by the script resetDirtyShopFeatures.pl.
Syntax |
$IsDirty = $Shop->featureIsDirty( $Feature ); $Shop->featureIsDirty( $Feature, $IsDirty ); |
Example |
$Shop->featureIsDirty( 'GallerySize', 1 ); |
Input |
|
Return |
|
featureIsVisible
Returns true shop feature is visible.
Syntax |
$IsVisible = $Shop->featureIsVisible( $Feature ); $Shop->featureIsVisible( $Feature ); |
Input |
|
Return |
|
featureMaxValue
Returns or sets the maximum value of a shop feature. It is not an error to set the featureMaxValue to a value less than featureCurrentValue.
Syntax |
$MaxValue = $Shop->featureMaxValue( $Feature ); $Shop->featureMaxValue( $Feature, $NewValue, $IsVisible ); |
Example |
if( $Shop->featureMaxValue( $FeatureProducts ) > $CurrentValue ) { ... }; my $OldMaxValue = $Shop->featureMaxValue( $FeatureProducts ); $Shop->featureMaxValue( $FeatureProducts, $OldMaxValue + 10 ); my $NewMaxValue = $Shop->featureMaxValue( $FeatureProducts ); |
Input |
|
Return |
|
featureTestValue
Throws error if feature is more used as possible.
Syntax |
$Shop->featureTestValue( $Feature ); |
Input |
|
features
Returns all features that are assigned to the shop.
Syntax |
$aFeature = $Shop->features; |
Return |
|
formatter
Returns the money formatter for the currency.
Syntax |
$Formatter = $Shop->formatter($CurrencyID); |
Input |
|
Return |
|
infoCountry
Return information about a country of the shop.
Syntax |
$Shop->infoCountry($CountryID); |
Input |
|
Return |
|
isCurrencyActive
Asks if the currency is active in the storefront.
Syntax |
$Shop->isCurrencyActive($CurrencyID); |
Input |
|
isTemporaryClosed
Returns true if the site is closed temporary. In this case all pages should be delivered with the HTTP status 503 (Service Temporarily Unavailable) to prevent search engines from caching the "shop closed" message.
Syntax |
$IsClosed = $Site->isTemporaryClosed; |
Return |
|
languages
Returns all languages that are assigned to the shop.
Syntax |
$aLanguageID = $Shop->languages; |
Return |
|
localeByLanguage
Returns the first locale for a given language, sorted by position.
Syntax |
$LocaleID = $Shop->localeByLanguage($LanguageID); |
Return |
|
regions
Returns all regions that are assigned to the shop.
Syntax |
$aRegions = $Shop->regions; |
Return |
|
removeCountry
Removes a Country from the shop.
Syntax |
$Shop->removeCountry($CountryID); |
Input |
|
removeCurrency
Removes a currency from the shop.
Syntax |
$Shop->removeCurrency($CurrencyID); |
Input |
|
removeLanguage
Removes a Language from the shop.
Syntax |
$Shop->removeLanguage($LanguageID); |
Input |
|
removeRegion
Removes a Region from the shop.
Syntax |
$Shop->removeRegion($Alias); |
Input |
|
updateCountry
Update the position of a country in the shop or set a country default.
Syntax |
$Shop->updateCountry($CountryID, $Position, $IsDefault); |
Input |
|
updateCurrency
Update the position of the currency in the shop.
Syntax |
$Shop->updateCurrency($CurrencyID, $Position); |
Input |
|
updateSiteLocale
Update the position of the sitelocale in the shop.
Syntax |
$Shop->updateSiteLocale($LocaleID, $Position); |
Input |
|