/** * Title with long invoice fee formatting * * @param string $title title from language pack * * @return array */ private function _longFeeTitle($title) { $longFee = str_replace("(xx)", $this->_formatter->formatPrice($this->_options['invoiceFee'], $this->_locale), $this->_translator->translate('format_invoicefee_not_included')); if ($this->_options['feepos'] == 'title') { return array("title" => str_replace('+XX', $longFee, $title), "extra" => ""); } return array("title" => str_replace('(+XX)', "", $title), "extra" => $longFee); }
/** * Get view data for table of pclasses * * @return array */ public function table() { $defaultId = 0; if ($this->_default instanceof KlarnaPClass) { $defaultId = $this->_default->getId(); } $out = array(); if (is_array($this->pclasses)) { foreach ($this->pclasses as $pid => $info) { $value = $this->_formatter->formatPrice($info['monthlyCost'], $info["locale"]); $default = $defaultId == $pid; $out[] = array('id' => $pid, 'description' => $info['pclass']->getDescription(), 'cost' => $info['monthlyCost'] > 0 ? $value : '', 'default' => $default); } } return $out; }