Version Notes
Stable for Magento Vesrion 1.7 and 1.8
Download this release
Release Info
| Developer | Niko K |
| Extension | Nikolakisae_PaymentLogo |
| Version | 0.1.3 |
| Comparing to | |
| See all releases | |
Code changes from version 0.1.2 to 0.1.3
- app/code/community/Nikolakisae/PaymentLogo/Block/Checkout/Onepage/Payment/Methods.php +14 -1
- app/code/community/Nikolakisae/PaymentLogo/Model/Adminhtml/System/Config/Source/LogoOptions.php +36 -0
- app/code/community/Nikolakisae/PaymentLogo/etc/config.xml +6 -1
- app/code/community/Nikolakisae/PaymentLogo/etc/system.xml +63 -0
- package.xml +6 -6
app/code/community/Nikolakisae/PaymentLogo/Block/Checkout/Onepage/Payment/Methods.php
CHANGED
|
@@ -22,14 +22,27 @@ class Nikolakisae_PaymentLogo_Block_Checkout_Onepage_Payment_Methods extends Mag
|
|
| 22 |
|
| 23 |
public function getMethodTitle(Mage_Payment_Model_Method_Abstract $method) {
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
if (file_exists(Mage::getBaseDir('media') . DS . 'payment' . DS . $method->getCode() . DS . Mage::getStoreConfig('payment/' . $method->getCode() . '/image')) && Mage::getStoreConfig('payment/' . $method->getCode() . '/image')) {
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
} else {
|
| 28 |
$form = $this->getChild('payment.method.' . $method->getCode());
|
| 29 |
if ($form && $form->hasMethodTitle()) {
|
| 30 |
return $this->escapeHtml($form->getMethodTitle());
|
| 31 |
}
|
| 32 |
}
|
|
|
|
| 33 |
return $this->escapeHtml($method->getTitle());
|
| 34 |
}
|
| 35 |
|
| 22 |
|
| 23 |
public function getMethodTitle(Mage_Payment_Model_Method_Abstract $method) {
|
| 24 |
|
| 25 |
+
|
| 26 |
+
$imageLogo = '';
|
| 27 |
+
$form = $this->getChild('payment.method.' . $method->getCode());
|
| 28 |
+
|
| 29 |
if (file_exists(Mage::getBaseDir('media') . DS . 'payment' . DS . $method->getCode() . DS . Mage::getStoreConfig('payment/' . $method->getCode() . '/image')) && Mage::getStoreConfig('payment/' . $method->getCode() . '/image')) {
|
| 30 |
+
$imageLogo = '<img src="' . Mage::getBaseUrl('media') . 'payment/' . $method->getCode() . '/' . Mage::getStoreConfig('payment/' . $method->getCode() . '/image') . '">';
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
if ($imageLogo != '' && Mage::getStoreConfig('payment/' . $method->getCode() . '/display_options') == 2) {
|
| 34 |
+
return $imageLogo;
|
| 35 |
+
} elseif ($imageLogo != '' && Mage::getStoreConfig('payment/' . $method->getCode() . '/display_options') == 3) {
|
| 36 |
+
return $this->escapeHtml($method->getTitle()).' '.$imageLogo;
|
| 37 |
+
} elseif ($imageLogo != '' && Mage::getStoreConfig('payment/' . $method->getCode() . '/display_options') == 4) {
|
| 38 |
+
return $imageLogo.' '.$this->escapeHtml($method->getTitle());
|
| 39 |
} else {
|
| 40 |
$form = $this->getChild('payment.method.' . $method->getCode());
|
| 41 |
if ($form && $form->hasMethodTitle()) {
|
| 42 |
return $this->escapeHtml($form->getMethodTitle());
|
| 43 |
}
|
| 44 |
}
|
| 45 |
+
|
| 46 |
return $this->escapeHtml($method->getTitle());
|
| 47 |
}
|
| 48 |
|
app/code/community/Nikolakisae/PaymentLogo/Model/Adminhtml/System/Config/Source/LogoOptions.php
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Nikolakisae
|
| 17 |
+
* @package Nikolakisae_PaymentLogo
|
| 18 |
+
* @author Niko K
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
class Nikolakisae_PaymentLogo_Model_Adminhtml_System_Config_Source_LogoOptions
|
| 22 |
+
{
|
| 23 |
+
/**
|
| 24 |
+
*
|
| 25 |
+
* @return array
|
| 26 |
+
*/
|
| 27 |
+
public function toOptionArray()
|
| 28 |
+
{
|
| 29 |
+
return array(
|
| 30 |
+
array('value' => 1, 'label' => 'Only Title'),
|
| 31 |
+
array('value' => 2, 'label' => 'Only Image Logo'),
|
| 32 |
+
array('value' => 3, 'label' => 'Title and Image Logo'),
|
| 33 |
+
array('value' => 4, 'label' => 'Image Logo and Title'),
|
| 34 |
+
);
|
| 35 |
+
}
|
| 36 |
+
}
|
app/code/community/Nikolakisae/PaymentLogo/etc/config.xml
CHANGED
|
@@ -2,10 +2,15 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Nikolakisae_PaymentLogo>
|
| 5 |
-
<version>0.1.
|
| 6 |
</Nikolakisae_PaymentLogo>
|
| 7 |
</modules>
|
| 8 |
<global>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
<blocks>
|
| 10 |
<paymentlogo>
|
| 11 |
<class>Nikolakisae_PaymentLogo_Block</class>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Nikolakisae_PaymentLogo>
|
| 5 |
+
<version>0.1.3</version>
|
| 6 |
</Nikolakisae_PaymentLogo>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 9 |
+
<models>
|
| 10 |
+
<paymentlogo>
|
| 11 |
+
<class>Nikolakisae_PaymentLogo_Model</class>
|
| 12 |
+
</paymentlogo>
|
| 13 |
+
</models>
|
| 14 |
<blocks>
|
| 15 |
<paymentlogo>
|
| 16 |
<class>Nikolakisae_PaymentLogo_Block</class>
|
app/code/community/Nikolakisae/PaymentLogo/etc/system.xml
CHANGED
|
@@ -30,6 +30,15 @@
|
|
| 30 |
<show_in_store>1</show_in_store>
|
| 31 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 32 |
</image>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
</fields>
|
| 34 |
</ccsave>
|
| 35 |
<checkmo translate="label">
|
|
@@ -52,6 +61,15 @@
|
|
| 52 |
<show_in_store>1</show_in_store>
|
| 53 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 54 |
</image>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
</fields>
|
| 56 |
</checkmo>
|
| 57 |
<purchaseorder translate="label">
|
|
@@ -74,6 +92,15 @@
|
|
| 74 |
<show_in_store>1</show_in_store>
|
| 75 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 76 |
</image>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
</fields>
|
| 78 |
</purchaseorder>
|
| 79 |
<banktransfer translate="label">
|
|
@@ -96,6 +123,15 @@
|
|
| 96 |
<show_in_store>1</show_in_store>
|
| 97 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 98 |
</image>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
</fields>
|
| 100 |
</banktransfer>
|
| 101 |
<cashondelivery translate="label">
|
|
@@ -118,6 +154,15 @@
|
|
| 118 |
<show_in_store>1</show_in_store>
|
| 119 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 120 |
</image>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
</fields>
|
| 122 |
</cashondelivery>
|
| 123 |
<authorizenet_directpost translate="label">
|
|
@@ -140,6 +185,15 @@
|
|
| 140 |
<show_in_store>1</show_in_store>
|
| 141 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 142 |
</image>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
</fields>
|
| 144 |
</authorizenet_directpost>
|
| 145 |
<authorizenet translate="label">
|
|
@@ -163,6 +217,15 @@
|
|
| 163 |
<show_in_store>1</show_in_store>
|
| 164 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 165 |
</image>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
</fields>
|
| 167 |
</authorizenet>
|
| 168 |
</groups>
|
| 30 |
<show_in_store>1</show_in_store>
|
| 31 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 32 |
</image>
|
| 33 |
+
<display_options translate="label">
|
| 34 |
+
<label>Display Logo Options</label>
|
| 35 |
+
<frontend_type>select</frontend_type>
|
| 36 |
+
<source_model>paymentlogo/adminhtml_system_config_source_logooptions</source_model>
|
| 37 |
+
<sort_order>3</sort_order>
|
| 38 |
+
<show_in_default>1</show_in_default>
|
| 39 |
+
<show_in_website>1</show_in_website>
|
| 40 |
+
<show_in_store>1</show_in_store>
|
| 41 |
+
</display_options>
|
| 42 |
</fields>
|
| 43 |
</ccsave>
|
| 44 |
<checkmo translate="label">
|
| 61 |
<show_in_store>1</show_in_store>
|
| 62 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 63 |
</image>
|
| 64 |
+
<display_options translate="label">
|
| 65 |
+
<label>Display Logo Options</label>
|
| 66 |
+
<frontend_type>select</frontend_type>
|
| 67 |
+
<source_model>paymentlogo/adminhtml_system_config_source_logooptions</source_model>
|
| 68 |
+
<sort_order>12</sort_order>
|
| 69 |
+
<show_in_default>1</show_in_default>
|
| 70 |
+
<show_in_website>1</show_in_website>
|
| 71 |
+
<show_in_store>1</show_in_store>
|
| 72 |
+
</display_options>
|
| 73 |
</fields>
|
| 74 |
</checkmo>
|
| 75 |
<purchaseorder translate="label">
|
| 92 |
<show_in_store>1</show_in_store>
|
| 93 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 94 |
</image>
|
| 95 |
+
<display_options translate="label">
|
| 96 |
+
<label>Display Logo Options</label>
|
| 97 |
+
<frontend_type>select</frontend_type>
|
| 98 |
+
<source_model>paymentlogo/adminhtml_system_config_source_logooptions</source_model>
|
| 99 |
+
<sort_order>3</sort_order>
|
| 100 |
+
<show_in_default>1</show_in_default>
|
| 101 |
+
<show_in_website>1</show_in_website>
|
| 102 |
+
<show_in_store>1</show_in_store>
|
| 103 |
+
</display_options>
|
| 104 |
</fields>
|
| 105 |
</purchaseorder>
|
| 106 |
<banktransfer translate="label">
|
| 123 |
<show_in_store>1</show_in_store>
|
| 124 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 125 |
</image>
|
| 126 |
+
<display_options translate="label">
|
| 127 |
+
<label>Display Logo Options</label>
|
| 128 |
+
<frontend_type>select</frontend_type>
|
| 129 |
+
<source_model>paymentlogo/adminhtml_system_config_source_logooptions</source_model>
|
| 130 |
+
<sort_order>12</sort_order>
|
| 131 |
+
<show_in_default>1</show_in_default>
|
| 132 |
+
<show_in_website>1</show_in_website>
|
| 133 |
+
<show_in_store>1</show_in_store>
|
| 134 |
+
</display_options>
|
| 135 |
</fields>
|
| 136 |
</banktransfer>
|
| 137 |
<cashondelivery translate="label">
|
| 154 |
<show_in_store>1</show_in_store>
|
| 155 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 156 |
</image>
|
| 157 |
+
<display_options translate="label">
|
| 158 |
+
<label>Display Logo Options</label>
|
| 159 |
+
<frontend_type>select</frontend_type>
|
| 160 |
+
<source_model>paymentlogo/adminhtml_system_config_source_logooptions</source_model>
|
| 161 |
+
<sort_order>12</sort_order>
|
| 162 |
+
<show_in_default>1</show_in_default>
|
| 163 |
+
<show_in_website>1</show_in_website>
|
| 164 |
+
<show_in_store>1</show_in_store>
|
| 165 |
+
</display_options>
|
| 166 |
</fields>
|
| 167 |
</cashondelivery>
|
| 168 |
<authorizenet_directpost translate="label">
|
| 185 |
<show_in_store>1</show_in_store>
|
| 186 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 187 |
</image>
|
| 188 |
+
<display_options translate="label">
|
| 189 |
+
<label>Display Logo Options</label>
|
| 190 |
+
<frontend_type>select</frontend_type>
|
| 191 |
+
<source_model>paymentlogo/adminhtml_system_config_source_logooptions</source_model>
|
| 192 |
+
<sort_order>32</sort_order>
|
| 193 |
+
<show_in_default>1</show_in_default>
|
| 194 |
+
<show_in_website>1</show_in_website>
|
| 195 |
+
<show_in_store>1</show_in_store>
|
| 196 |
+
</display_options>
|
| 197 |
</fields>
|
| 198 |
</authorizenet_directpost>
|
| 199 |
<authorizenet translate="label">
|
| 217 |
<show_in_store>1</show_in_store>
|
| 218 |
<comment>Allowed file types: jpeg, gif, png.</comment>
|
| 219 |
</image>
|
| 220 |
+
<display_options translate="label">
|
| 221 |
+
<label>Display Logo Options</label>
|
| 222 |
+
<frontend_type>select</frontend_type>
|
| 223 |
+
<source_model>paymentlogo/adminhtml_system_config_source_logooptions</source_model>
|
| 224 |
+
<sort_order>4</sort_order>
|
| 225 |
+
<show_in_default>1</show_in_default>
|
| 226 |
+
<show_in_website>1</show_in_website>
|
| 227 |
+
<show_in_store>1</show_in_store>
|
| 228 |
+
</display_options>
|
| 229 |
</fields>
|
| 230 |
</authorizenet>
|
| 231 |
</groups>
|
package.xml
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Nikolakisae_PaymentLogo</name>
|
| 4 |
-
<version>0.1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Payment Logo extension for Magento</summary>
|
| 10 |
-
<description>
|
| 11 |
Check / Money order, Purchase Order, Authorize.net, Authorize.net Direct Post</description>
|
| 12 |
-
<notes>Stable for Magento Vesrion 1.7</notes>
|
| 13 |
<authors><author><name>Niko K</name><user>nikolakisae</user><email>info@nikolakisae.com</email></author></authors>
|
| 14 |
-
<date>2013-
|
| 15 |
-
<time>11:
|
| 16 |
-
<contents><target name="magecommunity"><dir name="Nikolakisae"><dir name="PaymentLogo"><dir name="Block"><dir name="Checkout"><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
| 19 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Nikolakisae_PaymentLogo</name>
|
| 4 |
+
<version>0.1.3</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Payment Logo extension for Magento</summary>
|
| 10 |
+
<description>Display a payment method logo or payment method logo and method title or method title and payment method logo or just method title for the Magento default payment methods: Credit Card (saved), Cash On Delivery, Bank Transfer Payment,
|
| 11 |
Check / Money order, Purchase Order, Authorize.net, Authorize.net Direct Post</description>
|
| 12 |
+
<notes>Stable for Magento Vesrion 1.7 and 1.8</notes>
|
| 13 |
<authors><author><name>Niko K</name><user>nikolakisae</user><email>info@nikolakisae.com</email></author></authors>
|
| 14 |
+
<date>2013-10-17</date>
|
| 15 |
+
<time>11:45:50</time>
|
| 16 |
+
<contents><target name="magecommunity"><dir name="Nikolakisae"><dir name="PaymentLogo"><dir name="Block"><dir name="Checkout"><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="5c0c7690813a0a33378333be2dafc937"/></dir></dir></dir></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="LogoOptions.php" hash="391ee39d7cad2fb9f1a9815f6fdc5e2c"/></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="f316baeeee76179e4f0eb7a7a4f8cc07"/><file name="system.xml" hash="754260c207bf28c1c4f3b958d1e94ab2"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="paymentlogo.xml" hash="c5e70d08bc64c3949f250f2cbbd2b71b"/></dir><dir name="template"><dir name="paymentlogo"><dir name="checkout"><dir name="onepage"><dir name="payment"><file name="methods.phtml" hash="1c34f86ea217f08f80135923ccc78ad5"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Nikolakisae_PaymentLogo.xml" hash="6c14b347d865169ed2a1dee3c86c2fa3"/></dir></target></contents>
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
| 19 |
</package>
|
