diff --git a/app/code/local/MM/Paypalpaylater/Block/Messages.php b/app/code/local/MM/Paypalpaylater/Block/Messages.php index 11259cb..442e723 100644 --- a/app/code/local/MM/Paypalpaylater/Block/Messages.php +++ b/app/code/local/MM/Paypalpaylater/Block/Messages.php @@ -15,18 +15,6 @@ class MM_Paypalpaylater_Block_Messages extends Mage_Core_Block_Template { */ protected $_paymentMethodCode = Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS; - const SDK_SRC = 'https://www.paypal.com/sdk/js?client-id=%s&locale=%s¤cy=%s&components=messages&enable-funding=paylater'; - - public function getSrcSdk() { - - return sprintf( MM_Paypalpaylater_Block_Messages::SDK_SRC, - - Mage::helper('mm_paypalpaylater')->getClientId(), - Mage::app()->getLocale()->getLocaleCode(), - Mage::app()->getStore()->getCurrentCurrencyCode() - ); - } - public function getAmount() { /** @var Mage_Catalog_Model_Product $currentProduct */ $currentProduct = Mage::registry('current_product'); diff --git a/app/code/local/MM/Paypalpaylater/Helper/Data.php b/app/code/local/MM/Paypalpaylater/Helper/Data.php index 5a18bc9..2dfa4f6 100644 --- a/app/code/local/MM/Paypalpaylater/Helper/Data.php +++ b/app/code/local/MM/Paypalpaylater/Helper/Data.php @@ -1,6 +1,24 @@ getClientId(), + Mage::app()->getLocale()->getLocaleCode(), + Mage::app()->getStore()->getCurrentCurrencyCode() + ); + $return = ""; + $return.= "var PAYPAL_SCRIPT = '".$url."';"; + $return.= "var sp = document.createElement('script');"; + $return.= "sp.setAttribute('src', PAYPAL_SCRIPT);"; + $return.= "sp.setAttribute('defer', true);"; + $return.= "document.head.appendChild(sp);"; + $return.= "]]>"; + return $return; + + } public function getConfig($path = null) { return Mage::getStoreConfig('mm_paypalpaylater/'.$path); @@ -33,4 +51,5 @@ public function getColor() { public function getTextsize() { return $this->getConfig('style/textsize'); } + } \ No newline at end of file diff --git a/app/design/frontend/base/default/layout/mm/paypalpaylater.xml b/app/design/frontend/base/default/layout/mm/paypalpaylater.xml index 33a0a95..28d0a59 100644 --- a/app/design/frontend/base/default/layout/mm/paypalpaylater.xml +++ b/app/design/frontend/base/default/layout/mm/paypalpaylater.xml @@ -1,21 +1,39 @@ - - - - - - 1 - - - - - - - - - - 1 - - - - + + + + + + + + ]]> + + + + + + + + + + + + + + + 1 + + + + + + + + + + 1 + + + + \ No newline at end of file diff --git a/app/design/frontend/base/default/template/mm/paypalpaylater/messages.phtml b/app/design/frontend/base/default/template/mm/paypalpaylater/messages.phtml index b55adf3..bb4cec8 100644 --- a/app/design/frontend/base/default/template/mm/paypalpaylater/messages.phtml +++ b/app/design/frontend/base/default/template/mm/paypalpaylater/messages.phtml @@ -12,5 +12,4 @@ data-pp-placement="getIsInCatalogProduct() ? 'product' : 'cart'; ?>" data-pp-amount="getAmount(); ?>" style="margin: 18px 0"> - - \ No newline at end of file + \ No newline at end of file