コード例 #1
0
 public static function onGetRateTypes()
 {
     $scale = array(0.5, 1, 1.5, 2, 5);
     $format = array('SUM' => function ($value, $format = null) {
         return Utils::formatToBaseCurrency($value, $format);
     });
     $units = array('SUM' => Utils::getBaseCurrencyUnit());
     // TODO deprecated
     return array('sale_payment' => array('NAME' => Loc::getMessage('SALE_CONVERSION_RATE_PAYMENT_NAME'), 'SCALE' => $scale, 'FORMAT' => $format, 'UNITS' => $units, 'MODULE' => 'sale', 'SORT' => 1100, 'COUNTERS' => array('conversion_visit_day', 'sale_payment_add_day', 'sale_payment_add', 'sale_payment_sum_add'), 'CALCULATE' => function (array $counters) {
         $denominator = $counters['conversion_visit_day'] ?: 0;
         $numerator = $counters['sale_payment_add_day'] ?: 0;
         $quantity = $counters['sale_payment_add'] ?: 0;
         $sum = $counters['sale_payment_sum_add'] ?: 0;
         return array('DENOMINATOR' => $denominator, 'NUMERATOR' => $numerator, 'QUANTITY' => $quantity, 'RATE' => $denominator ? $numerator / $denominator : 0, 'SUM' => $sum);
     }), 'sale_order' => array('NAME' => Loc::getMessage('SALE_CONVERSION_RATE_ORDER_NAME'), 'SCALE' => $scale, 'FORMAT' => $format, 'UNITS' => $units, 'MODULE' => 'sale', 'SORT' => 1200, 'COUNTERS' => array('conversion_visit_day', 'sale_order_add_day', 'sale_order_add', 'sale_order_sum_add'), 'CALCULATE' => function (array $counters) {
         $denominator = $counters['conversion_visit_day'] ?: 0;
         $numerator = $counters['sale_order_add_day'] ?: 0;
         $quantity = $counters['sale_order_add'] ?: 0;
         $sum = $counters['sale_order_sum_add'] ?: 0;
         return array('DENOMINATOR' => $denominator, 'NUMERATOR' => $numerator, 'QUANTITY' => $quantity, 'RATE' => $denominator ? $numerator / $denominator : 0, 'SUM' => $sum);
     }), 'sale_cart' => array('NAME' => Loc::getMessage('SALE_CONVERSION_RATE_CART_NAME'), 'SCALE' => $scale, 'FORMAT' => $format, 'UNITS' => $units, 'MODULE' => 'sale', 'SORT' => 1300, 'COUNTERS' => array('conversion_visit_day', 'sale_cart_add_day', 'sale_cart_add', 'sale_cart_sum_add'), 'CALCULATE' => function (array $counters) {
         $denominator = $counters['conversion_visit_day'] ?: 0;
         $numerator = $counters['sale_cart_add_day'] ?: 0;
         $quantity = $counters['sale_cart_add'] ?: 0;
         $sum = $counters['sale_cart_sum_add'] ?: 0;
         return array('DENOMINATOR' => $denominator, 'NUMERATOR' => $numerator, 'QUANTITY' => $quantity, 'RATE' => $denominator ? $numerator / $denominator : 0, 'SUM' => $sum);
     }));
 }
コード例 #2
0
ファイル: calc.php プロジェクト: vim84/b-markt
,
				initialGrosses = <?php 
echo Json::encode($initialGrosses);
?>
,
				funnelData     = <?php 
echo Json::encode($funnelData);
?>
,
				funnel         = new AmCharts.AmFunnelChart();

			funnel.dataProvider       = funnelData;
			funnel.theme              = 'none';
			funnel.labelText          = ' ';
			funnel.balloonText        = '[[title]]: <span style="white-space: nowrap; ">[[value]] <?php 
echo CUtil::JSEscape(Utils::getBaseCurrencyUnit());
?>
</span>';
			funnel.titleField         = 'title';
			funnel.valueField         = 'value';
			funnel.thousandsSeparator = ' ';
			funnel.depth3D            = 160;
			funnel.angle              = 23;
			funnel.outlineAlpha       = 2;
			funnel.outlineColor       = '#FFFFFF';
			funnel.outlineThickness   = 2;
			funnel.marginRight        = 50;
			funnel.marginLeft         = 50;
			funnel.balloon            = {'fixedPosition': true};
			funnel.write('bitrix-conversion-funnel');
コード例 #3
0
ファイル: config.php プロジェクト: Satariall/izurit
 /** @deprecated */
 public static function getBaseCurrencyUnit()
 {
     return Utils::getBaseCurrencyUnit();
 }