Version Notes
Stable
Download this release
Release Info
Developer | Magento Core Team |
Extension | MB_AdminMoney |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
app/code/community/MB/AdminMoney/Model/Observer.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class MB_AdminMoney_Model_Observer
|
4 |
+
{
|
5 |
+
public function paymentMethodIsActive($observer)
|
6 |
+
{
|
7 |
+
$instance = $observer->getMethodInstance();
|
8 |
+
$result = $observer->getResult();
|
9 |
+
|
10 |
+
if ($instance->getCode() == "checkmo") {
|
11 |
+
if (Mage::app()->getStore()->isAdmin() && Mage::getStoreConfig('payment/checkmo/admin_active') == "1") {
|
12 |
+
$result->isAvailable = true;
|
13 |
+
} else if (!Mage::app()->getStore()->isAdmin() && Mage::getStoreConfig('payment/checkmo/admin_active') == "1") {
|
14 |
+
$result->isAvailable = false;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
}
|
18 |
+
}
|
app/code/community/MB/AdminMoney/etc/config.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<MB_AdminMoney>
|
5 |
+
<version>0.0.1</version>
|
6 |
+
</MB_AdminMoney>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
<models>
|
11 |
+
<MB_AdminMoney>
|
12 |
+
<class>MB_AdminMoney_Model</class>
|
13 |
+
</MB_AdminMoney>
|
14 |
+
</models>
|
15 |
+
<events>
|
16 |
+
<payment_method_is_active>
|
17 |
+
<observers>
|
18 |
+
<MB_AdminMoney>
|
19 |
+
<type>singleton</type>
|
20 |
+
<class>MB_AdminMoney/Observer</class>
|
21 |
+
<method>paymentMethodIsActive</method>
|
22 |
+
</MB_AdminMoney>
|
23 |
+
</observers>
|
24 |
+
</payment_method_is_active>
|
25 |
+
</events>
|
26 |
+
</global>
|
27 |
+
|
28 |
+
</config>
|
app/code/community/MB/AdminMoney/etc/system.xml
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-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 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category Mage
|
23 |
+
* @package Mage_Payment
|
24 |
+
* @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<config>
|
29 |
+
<sections>
|
30 |
+
<payment translate="label" module="payment">
|
31 |
+
<groups>
|
32 |
+
<checkmo translate="label">
|
33 |
+
<fields>
|
34 |
+
<admin_active translate="label">
|
35 |
+
<label>Enabled in admin only</label>
|
36 |
+
<frontend_type>select</frontend_type>
|
37 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
38 |
+
<sort_order>1</sort_order>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>0</show_in_store>
|
42 |
+
</admin_active>
|
43 |
+
</fields>
|
44 |
+
</checkmo>
|
45 |
+
</groups>
|
46 |
+
</payment>
|
47 |
+
</sections>
|
48 |
+
</config>
|
app/etc/modules/MB_AdminMoney.xml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<MB_AdminMoney>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<depends>
|
8 |
+
<Mage_Payment/>
|
9 |
+
</depends>
|
10 |
+
</MB_AdminMoney>
|
11 |
+
</modules>
|
12 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>MB_AdminMoney</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license/>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This module enables Check/Money order ONLY in the admin to place orders without paying them.</summary>
|
10 |
+
<description>This module enables Check/Money order ONLY in the admin to place orders without paying them. This can be useful for several cases as promotions, sponsorships and gifs who needs to be in the shop record.
|
11 |
+

|
12 |
+
As an extra I added a system config to allow this feature to be controlled with a select in System - Configuration - Payment Methods - Check / Money Order - Enabled in admin only
|
13 |
+

|
14 |
+
Remember to enable Check / Money Order to make this extension work.
|
15 |
+

|
16 |
+
Source: http://stackoverflow.com/questions/14022921/cash-on-delivery-activated-admin-only-not-frontend-enabled-magento
|
17 |
+

|
18 |
+
Original idea: http://stackoverflow.com/users/773329/swiftotter-studios</description>
|
19 |
+
<notes>Stable</notes>
|
20 |
+
<authors><author><name>Miguel Balparda</name><user>auto-converted</user><email>miguel.balparda@moozo.com.ar</email></author></authors>
|
21 |
+
<date>2014-11-28</date>
|
22 |
+
<time>22:23:19</time>
|
23 |
+
<contents><target name="magecommunity"><dir name="MB"><dir name="AdminMoney"><dir name="Model"><file name="Observer.php" hash="508621a82383be03854e4fba6cb4e008"/></dir><dir name="etc"><file name="config.xml" hash="ca47b4f0de4b141eb0b601dc44a692cd"/><file name="system.xml" hash="54c375dc50144ff851519d703a6dbf61"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MB_AdminMoney.xml" hash="46e2ebef95c5e198654b9ab45ee68cd3"/></dir></target></contents>
|
24 |
+
<compatible/>
|
25 |
+
<dependencies/>
|
26 |
+
</package>
|