/** * Show the ppBox for given price. * * @param float $price price * @param int $page KlarnaFlags page flag * * @return void */ public function showPPBox($price, $page = KlarnaFlags::PRODUCT_PAGE) { if (!$this->_enabled) { return; } if (!KiTT_CountryLogic::isBelowLimit($this->_country, $price)) { return; } $templateLoader = KiTT::templateLoader($this->_locale); $cssLoader = $templateLoader->load('css.mustache'); $jsLoader = $templateLoader->load('javascript.mustache'); $merchantID = KlarnaConstant::merchantID(KiTT::PART, $this->_country); $styles = array("includes/external/klarna/template/css/oscstyle.css", "includes/modules/payment/klarna/productprice/style.css", EXTERNAL_KITT . "pp/v1.0/pp.css?eid=" . $merchantID); if (KlarnaConstant::isLegacyShop()) { $styles[] = "includes/external/klarna/template/css/klarna22rc2a.css"; } $html = $cssLoader->render(array('styles' => $styles)); $html .= $jsLoader->render(array("scripts" => array(EXTERNAL_KITT . "core/v1.0/js/klarna.min.js", EXTERNAL_KITT . "res/v1.0/js/klarna.lib.min.js", EXTERNAL_KITT . "pp/v1.0/js/productprice.min.js"))); $html .= "<div style='clear: both;'></div>"; $html .= KiTT::partPaymentBox($this->_locale, $price, $page)->show(); return $html; }