Source of file CanBeFreeCurrency.php
Size: 0,431 Bytes - Last Modified: 2021-12-24T06:35:03+00:00
/var/www/docs.ssmods.com/process/src/src/ORM/FieldType/CanBeFreeCurrency.php
1234567891011121314151617181920 | <?php namespace SilverShop\ORM\FieldType; use SilverStripe\ORM\FieldType\DBCurrency; /** * Allows casting some template values to show "FREE" instead of $0.00. */ class CanBeFreeCurrency extends DBCurrency { public function Nice() { if ($this->value == 0) { return _t('SilverShop\ORM\FieldType\ShopCurrency.Free', '<span class="free">FREE</span>'); } return parent::Nice(); } } |