diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php index 1fdb6e4bf..85c2c1709 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php @@ -31,6 +31,7 @@ use Thelia\Core\Template\ParserContext; use Thelia\Core\Template\Smarty\SmartyPluginDescriptor; use Thelia\Model\CategoryQuery; use Thelia\Model\ContentQuery; +use Thelia\Model\CurrencyQuery; use Thelia\Model\FolderQuery; use Thelia\Model\Product; use Thelia\Model\ProductQuery; @@ -132,6 +133,24 @@ class DataAccessFunctions extends AbstractSmartyPlugin } } + /** + * currency global data + * + * @param $params + * @param $smarty + */ + public function currencyDataAccess($params, $smarty) + { + $currency = $this->request->getSession()->getCurrency(); + + if ($currency) { + $currencyQuery = CurrencyQuery::create() + ->filterById($currency->getId()); + + return $this->dataAccessWithI18n("Currency", $params, $currencyQuery, array("NAME")); + } + } + /** * @param $objectLabel * @param $params @@ -231,6 +250,7 @@ class DataAccessFunctions extends AbstractSmartyPlugin new SmartyPluginDescriptor('function', 'category', $this, 'categoryDataAccess'), new SmartyPluginDescriptor('function', 'content', $this, 'contentDataAccess'), new SmartyPluginDescriptor('function', 'folder', $this, 'folderDataAccess'), + new SmartyPluginDescriptor('function', 'currency', $this, 'currencyDataAccess'), ); } } diff --git a/templates/default/layout.tpl b/templates/default/layout.tpl index 1def30301..3fc7a4662 100644 --- a/templates/default/layout.tpl +++ b/templates/default/layout.tpl @@ -130,10 +130,10 @@ URL: http://www.thelia.net