Skip to content

Commit

Permalink
Ticket #3663 - Better PRICE field
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Jan 26, 2022
1 parent a9ec821 commit 4e8ec55
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions inc/classes/BxDolLanguages.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function _t_format_duration ($iTime)
return strftime($sFormat, $iTime);
}

function _t_format_currency ($fPrice, $iPrecision = 2, $bFormatThousands = false)
function _t_format_currency ($fPrice, $iPrecision = 2, $bFormatThousands = true)
{
$sSign = BxDolPayments::getInstance()->getOption('default_currency_sign');
if(empty($sSign))
Expand Down Expand Up @@ -433,7 +433,7 @@ function _t_format_duration($iTime)
return BxDolLanguages::getInstance()->_t_format_duration($iTime);
}

function _t_format_currency($fPrice, $iPrecision = 2, $bFormatThousands = false)
function _t_format_currency($fPrice, $iPrecision = 2, $bFormatThousands = true)
{
return BxDolLanguages::getInstance()->_t_format_currency($fPrice, $iPrecision, $bFormatThousands);
}
Expand Down
5 changes: 0 additions & 5 deletions modules/boonex/ads/classes/BxAdsFormEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,6 @@ protected function genCustomViewRowValueCategoryView(&$aInput)
return $this->_oModule->_oTemplate->parseLink($sLink, bx_process_output(_t($aCategory['title'])));
}

protected function genCustomViewRowValuePrice(&$aInput)
{
return isset($aInput['value']) && $aInput['value'] !== '' ? _t_format_currency(bx_process_output($aInput['value'])) : null;
}

protected function genCustomViewRowValueQuantity(&$aInput)
{
return (int)$aInput['value'] > 0 ? (int)$aInput['value'] : 0;
Expand Down
2 changes: 1 addition & 1 deletion modules/boonex/english/data/langs/system/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ If it is not enabled then please consider implement this optimization, since it
<string name="_sys_connect_option_approve"><![CDATA[Always approve profiles when joined using this module]]></string>
<string name="_sys_connect_option_privacy"><![CDATA[Default privacy for created profiles]]></string>

<string name="_sys_currency"><![CDATA[{0}{1}]]></string>
<string name="_sys_currency"><![CDATA[{0} {1}]]></string>
<string name="_sys_decline"><![CDATA[Decline]]></string>
<string name="_sys_designbox_0"><![CDATA[Content]]></string>
<string name="_sys_designbox_1"><![CDATA[Content + Title + Background]]></string>
Expand Down
2 changes: 1 addition & 1 deletion modules/boonex/russian/data/langs/system/ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2084,7 +2084,7 @@
<string name="_sys_connect_option_approve"><![CDATA[Всегда одобрять профиль, когда заходят через это соединение]]></string>
<string name="_sys_connect_option_privacy"><![CDATA[Настройки конфиденциальности для созданных профилей]]></string>

<string name="_sys_currency"><![CDATA[{0}{1}]]></string>
<string name="_sys_currency"><![CDATA[{0} {1}]]></string>
<string name="_sys_decline"><![CDATA[Отклонить]]></string>
<string name="_sys_designbox_0"><![CDATA[Содержимое]]></string>
<string name="_sys_designbox_1"><![CDATA[Содержимое + заголовок + фон]]></string>
Expand Down
7 changes: 7 additions & 0 deletions template/scripts/BxBaseFormView.php
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,13 @@ function genViewRowValue(&$aInput)
$sValue = null;
break;

case 'price':
if(isset($aInput['value']) && $aInput['value'] !== '')
$sValue = _t_format_currency(bx_process_output($aInput['value']));
else
$sValue = null;
break;

default:
if(isset($aInput['value']) && '' !== $aInput['value']) {
$sValue = $aInput['value'];
Expand Down

0 comments on commit 4e8ec55

Please sign in to comment.