[*] FO : $currency->prefix and $currency->suffix are now a convenient shortcut for displaying price

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9661 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mMarinetti
2011-10-26 17:41:32 +00:00
parent 62465a7920
commit 90853d47e7
+19
View File
@@ -73,8 +73,27 @@ class CurrencyCore extends ObjectModel
protected $webserviceParameters = array(
'objectsNodeName' => 'currencies',
);
/**
* contains the sign to display before price, according to its format
* @var string
*/
public $prefix = null;
/**
* contains the sign to display after price, according to its format
* @var string
*/
public $suffix = null;
public function __construct($id = null, $id_lang = null, $id_shop = null)
{
parent::__construct($id, $id_lang, $id_shop);
// prefix and suffix are convenient shortcut for displaying
// price sign before or after the price number
$this->prefix = $this->format % 2 != 0 ? $this->sign.' ' : '';
$this->suffix = $this->format % 2 == 0 ? ' '.$this->sign : '';
}
/**
* Overriding check if currency with the same iso code already exists.
* If it's true, currency is doesn't added.