PHP Класс ShopTools, silvershop-core

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
DBConn ( string $name = 'default' ) : SS_Database Get the DB connection in a SS 3.1 and 3.2+ compatible way
get_current_locale ( ) : string Get the current locale.
install_locale ( string $locale ) Set/Install the given locale.
price_for_display ( mixed $price ) : Money Convert a numeric price to the shop currency

Описание методов

DBConn() публичный статический Метод

Get the DB connection in a SS 3.1 and 3.2+ compatible way
public static DBConn ( string $name = 'default' ) : SS_Database
$name string
Результат SS_Database

get_current_locale() публичный статический Метод

Tries to get the locale from Translatable, Fluent or the default i18n (depending on what is installed)
public static get_current_locale ( ) : string
Результат string the locale in use

install_locale() публичный статический Метод

This does set the i18n locale as well as the Translatable or Fluent locale (if any of these modules is installed)
public static install_locale ( string $locale )
$locale string the locale to install

price_for_display() публичный статический Метод

Convert a numeric price to the shop currency
public static price_for_display ( mixed $price ) : Money
$price mixed the price to convert
Результат Money the price wrapped in a Money DBField to be used for templates or similar