Code Duplication    Length = 13-13 lines in 6 locations

catalog/includes/modules/payment/sage_pay_direct.php 1 location

@@ 916-928 (lines=13) @@
913
    }
914
915
// format prices without currency formatting
916
    function format_raw($number, $currency_code = '', $currency_value = '') {
917
      global $currencies;
918
919
      if (empty($currency_code) || !$currencies->is_set($currency_code)) {
920
        $currency_code = $_SESSION['currency'];
921
      }
922
923
      if (empty($currency_value) || !is_numeric($currency_value)) {
924
        $currency_value = $currencies->currencies[$currency_code]['value'];
925
      }
926
927
      return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', '');
928
    }
929
930
    function getCardTypes() {
931
      $this->_cards = array();

catalog/includes/modules/payment/sage_pay_server.php 1 location

@@ 526-538 (lines=13) @@
523
    }
524
525
// format prices without currency formatting
526
    function format_raw($number, $currency_code = '', $currency_value = '') {
527
      global $currencies;
528
529
      if (empty($currency_code) || !$currencies->is_set($currency_code)) {
530
        $currency_code = $_SESSION['currency'];
531
      }
532
533
      if (empty($currency_value) || !is_numeric($currency_value)) {
534
        $currency_value = $currencies->currencies[$currency_code]['value'];
535
      }
536
537
      return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', '');
538
    }
539
540
    function loadErrorMessages() {
541
      $errors = array();

catalog/includes/modules/header_tags/ht_google_analytics.php 1 location

@@ 108-120 (lines=13) @@
105
      }
106
    }
107
108
    function format_raw($number, $currency_code = '', $currency_value = '') {
109
      global $currencies;
110
111
      if (empty($currency_code) || !$currencies->is_set($currency_code)) {
112
        $currency_code = $_SESSION['currency'];
113
      }
114
115
      if (empty($currency_value) || !is_numeric($currency_value)) {
116
        $currency_value = $currencies->currencies[$currency_code]['value'];
117
      }
118
119
      return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', '');
120
    }
121
122
    function isEnabled() {
123
      return $this->enabled;

catalog/includes/modules/payment/sage_pay_form.php 1 location

@@ 483-495 (lines=13) @@
480
    }
481
482
// format prices without currency formatting
483
    function format_raw($number, $currency_code = '', $currency_value = '') {
484
      global $currencies;
485
486
      if (empty($currency_code) || !$currencies->is_set($currency_code)) {
487
        $currency_code = $_SESSION['currency'];
488
      }
489
490
      if (empty($currency_value) || !is_numeric($currency_value)) {
491
        $currency_value = $currencies->currencies[$currency_code]['value'];
492
      }
493
494
      return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', '');
495
    }
496
497
    function getOrderTotalsSummary() {
498
      global $order_total_modules;

catalog/includes/modules/header_tags/ht_google_adwords_conversion.php 1 location

@@ 84-96 (lines=13) @@
81
      }
82
    }
83
84
    function format_raw($number, $currency_code = '', $currency_value = '') {
85
      global $currencies;
86
87
      if (empty($currency_code) || !$currencies->is_set($currency_code)) {
88
        $currency_code = $_SESSION['currency'];
89
      }
90
91
      if (empty($currency_value) || !is_numeric($currency_value)) {
92
        $currency_value = $currencies->currencies[$currency_code]['value'];
93
      }
94
95
      return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', '');
96
    }
97
98
    function isEnabled() {
99
      return $this->enabled;

catalog/includes/modules/header_tags/ht_product_opengraph.php 1 location

@@ 144-156 (lines=13) @@
141
      return array('MODULE_HEADER_TAGS_PRODUCT_OPENGRAPH_STATUS', 'MODULE_HEADER_TAGS_PRODUCT_OPENGRAPH_SORT_ORDER');
142
    }
143
144
    function format_raw($number, $currency_code = '', $currency_value = '') {
145
      global $currencies;
146
147
      if (empty($currency_code) || !$currencies->is_set($currency_code)) {
148
        $currency_code = $_SESSION['currency'];
149
      }
150
151
      if (empty($currency_value) || !is_numeric($currency_value)) {
152
        $currency_value = $currencies->currencies[$currency_code]['value'];
153
      }
154
155
      return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', '');
156
    }
157
  }
158
159