// Code review
This commit is contained in:
@@ -103,7 +103,7 @@ class Dashgoals extends Module
|
||||
$month_row['values'][$type] = ConfigurationKPI::get(strtoupper($key));
|
||||
}
|
||||
|
||||
$this->context->smarty->assign('currency_code', $this->context->currency->iso_code);
|
||||
$this->context->smarty->assign('currency', $this->context->currency);
|
||||
$this->context->smarty->assign('goals_year', $year);
|
||||
$this->context->smarty->assign('goals_months', $months);
|
||||
return $this->display(__FILE__, 'dashboard_zone_two.tpl');
|
||||
|
||||
@@ -22,9 +22,9 @@ function dashgoals_calc_sales()
|
||||
var key = $(this).attr('id').substr(16);
|
||||
var sales = parseFloat($('#dashgoals_traffic_' + key).val()) * parseFloat($('#dashgoals_avg_cart_value_' + key).val()) * parseFloat($('#dashgoals_conversion_' + key).val()) / 100;
|
||||
if (isNaN(sales))
|
||||
$(this).text('0');
|
||||
$(this).text(formatCurrency(0, currency_format, currency_sign, currency_blank));
|
||||
else
|
||||
$(this).text(parseInt(sales));
|
||||
$(this).text(formatCurrency(parseInt(sales), currency_format, currency_sign, currency_blank));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,13 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script>
|
||||
var currency_format = {$currency->format|intval};
|
||||
var currency_sign = '{$currency->sign|addslashes}';
|
||||
var currency_blank = {$currency->blank|intval};
|
||||
var priceDisplayPrecision = 0;
|
||||
</script>
|
||||
|
||||
<section id="dashgoals" class="panel widget">
|
||||
<header class="panel-heading">
|
||||
<i class="icon-bar-chart"></i> {l s='Goals' mod='dashgoals'}
|
||||
@@ -55,8 +62,10 @@
|
||||
{$month.label}
|
||||
</td>
|
||||
<td>
|
||||
<input id="dashgoals_traffic_{$month@key}" name="dashgoals_traffic_{$month@key}" class="dashgoals_config_input form-control"
|
||||
value="{$month.values.traffic|intval}" />
|
||||
<div class="input-group">
|
||||
<input id="dashgoals_traffic_{$month@key}" name="dashgoals_traffic_{$month@key}" class="dashgoals_config_input form-control"
|
||||
value="{$month.values.traffic|intval}" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
@@ -67,7 +76,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currency_code|escape}</span>
|
||||
<span class="input-group-addon">{$currency->iso_code|escape}</span>
|
||||
<input id="dashgoals_avg_cart_value_{$month@key}" name="dashgoals_avg_cart_value_{$month@key}" class="dashgoals_config_input form-control"
|
||||
value="{$month.values.avg_cart_value|intval}" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user