MSP_CashOnDelivery - Version 1.0.0

Version Notes

Enjoy it ;)

Download this release

Release Info

Developer Riccardo Tempesta
Extension MSP_CashOnDelivery
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (32) hide show
  1. app/code/community/MSP/CashOnDelivery/Block/Admin/Rule.php +37 -0
  2. app/code/community/MSP/CashOnDelivery/Block/Admin/Rule/Edit.php +42 -0
  3. app/code/community/MSP/CashOnDelivery/Block/Admin/Rule/Edit/Form.php +92 -0
  4. app/code/community/MSP/CashOnDelivery/Block/Admin/Rule/Grid.php +109 -0
  5. app/code/community/MSP/CashOnDelivery/Block/Form.php +60 -0
  6. app/code/community/MSP/CashOnDelivery/Block/Sales/Order/Total.php +34 -0
  7. app/code/community/MSP/CashOnDelivery/COMPATIBILITY.txt +10 -0
  8. app/code/community/MSP/CashOnDelivery/Helper/Data.php +120 -0
  9. app/code/community/MSP/CashOnDelivery/LICENSE.txt +11 -0
  10. app/code/community/MSP/CashOnDelivery/Model/Cashondelivery.php +67 -0
  11. app/code/community/MSP/CashOnDelivery/Model/Foreign.php +30 -0
  12. app/code/community/MSP/CashOnDelivery/Model/Local.php +30 -0
  13. app/code/community/MSP/CashOnDelivery/Model/Mysql4/Foreign.php +27 -0
  14. app/code/community/MSP/CashOnDelivery/Model/Mysql4/Foreign/Collection.php +27 -0
  15. app/code/community/MSP/CashOnDelivery/Model/Mysql4/Local.php +27 -0
  16. app/code/community/MSP/CashOnDelivery/Model/Mysql4/Local/Collection.php +27 -0
  17. app/code/community/MSP/CashOnDelivery/Model/Order/Pdf/Total/Default.php +43 -0
  18. app/code/community/MSP/CashOnDelivery/Model/Order/Total.php +39 -0
  19. app/code/community/MSP/CashOnDelivery/Model/Quote/Total.php +80 -0
  20. app/code/community/MSP/CashOnDelivery/controllers/Adminhtml/Cashondelivery/ForeignController.php +25 -0
  21. app/code/community/MSP/CashOnDelivery/controllers/Adminhtml/Cashondelivery/LocalController.php +25 -0
  22. app/code/community/MSP/CashOnDelivery/controllers/Adminhtml/CashondeliveryController.php +133 -0
  23. app/code/community/MSP/CashOnDelivery/etc/config.xml +250 -0
  24. app/code/community/MSP/CashOnDelivery/etc/system.xml +187 -0
  25. app/code/community/MSP/CashOnDelivery/sql/msp_cashondelivery_setup/mysql4-install-1.0.0.php +58 -0
  26. app/design/adminhtml/default/default/layout/msp_cashondelivery.xml +51 -0
  27. app/design/adminhtml/default/default/template/msp_cashondelivery/form.phtml +30 -0
  28. app/design/frontend/base/default/layout/msp_cashondelivery.xml +68 -0
  29. app/design/frontend/base/default/template/msp_cashondelivery/form.phtml +34 -0
  30. app/etc/modules/MSP_CashOnDelivery.xml +32 -0
  31. app/locale/it_IT/MSP_CashOnDelivery.csv +33 -0
  32. package.xml +18 -0
app/code/community/MSP/CashOnDelivery/Block/Admin/Rule.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Block_Admin_Rule extends Mage_Adminhtml_Block_Widget_Grid_Container
22
+ {
23
+ protected $zoneType=null;
24
+
25
+ public function _construct()
26
+ {
27
+ $this->zoneType = Mage::registry('msp_cashondelivery_zone');
28
+ $zoneType = ucfirst($this->zoneType);
29
+
30
+ $this->_blockGroup = 'msp_cashondelivery';
31
+ $this->_controller = 'admin_rule';
32
+ $this->_headerText = Mage::helper('msp_cashondelivery')->__('MSP Cash on delivery prices - '.$zoneType.' fee');
33
+ $this->_addButtonLabel = Mage::helper('msp_cashondelivery')->__('Add New Price Rule');
34
+
35
+ parent::_construct();
36
+ }
37
+ }
app/code/community/MSP/CashOnDelivery/Block/Admin/Rule/Edit.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Block_Admin_Rule_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
22
+ {
23
+ public function _construct()
24
+ {
25
+ parent::_construct();
26
+ $this->_objectId = 'id';
27
+ $this->_blockGroup = 'msp_cashondelivery';
28
+ $this->_controller = 'admin_rule';
29
+ $this->_updateButton('save', 'label', Mage::helper('msp_cashondelivery')->__('Save Rule'));
30
+ $this->_updateButton('delete', 'label', Mage::helper('msp_cashondelivery')->__('Delete Rule'));
31
+ }
32
+
33
+ public function getHeaderText()
34
+ {
35
+ if( Mage::registry('msp_cashondelivery_data') && Mage::registry('msp_cashondelivery_data')->getId() ) {
36
+ return Mage::helper('msp_cashondelivery')->__("Edit Rule");
37
+ } else {
38
+ return Mage::helper('msp_cashondelivery')->__('Add Rule');
39
+
40
+ }
41
+ }
42
+ }
app/code/community/MSP/CashOnDelivery/Block/Admin/Rule/Edit/Form.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Block_Admin_Rule_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
22
+ {
23
+ protected $zoneType = null;
24
+
25
+ protected function _construct() {
26
+ parent::_construct();
27
+ $this->zoneType = Mage::registry('msp_cashondelivery_zone');
28
+ }
29
+
30
+ protected function getRule()
31
+ {
32
+ return Mage::registry('msp_cashondelivery_data');
33
+ }
34
+
35
+ protected function _prepareForm()
36
+ {
37
+ $values = array();
38
+ if (!$this->getRule() || !$this->getRule()->getId()) // Default values
39
+ {
40
+ $values = array(
41
+ 'amount_from' => 0
42
+ );
43
+ }
44
+ else
45
+ {
46
+ $values = $this->getRule()->getData();
47
+ }
48
+
49
+ $form = new Varien_Data_Form(array(
50
+ 'id' => 'edit_form',
51
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
52
+ 'method' => 'post',
53
+ ));
54
+
55
+ $fieldset = $form->addFieldset('msp_cashondelivery_', array('legend' => Mage::helper('msp_cashondelivery')->__('Cash on delivery fee')));
56
+
57
+ $fieldset->addField('amount_from', 'text', array(
58
+ 'label' => Mage::helper('msp_cashondelivery')->__('Apply from amount'),
59
+ 'required' => true,
60
+ 'name' => 'amount_from',
61
+ ));
62
+
63
+ $fieldset->addField('fixed_fee', 'text', array(
64
+ 'label' => Mage::helper('msp_cashondelivery')->__('Fixed Fee'),
65
+ 'required' => false,
66
+ 'name' => 'fixed_fee',
67
+ ));
68
+
69
+ $fieldset->addField('percent_fee', 'text', array(
70
+ 'label' => Mage::helper('msp_cashondelivery')->__('Percentual Fee'),
71
+ 'required' => false,
72
+ 'name' => 'percent_fee',
73
+ ));
74
+
75
+ if (Mage::getSingleton('adminhtml/session')->getMspCashondeliveryData())
76
+ {
77
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getMspCashondeliveryData());
78
+ Mage::getSingleton('adminhtml/session')->getMspCashondeliveryData(null);
79
+ }
80
+ elseif (Mage::registry('msp_cashondelivery'))
81
+ {
82
+ die("i dati ci sono!");
83
+ $form->setValues(Mage::registry('msp_cashondelivery_data')->getData());
84
+ }
85
+ $form->setValues($values);
86
+
87
+ $form->setUseContainer(true);
88
+ $this->setForm($form);
89
+
90
+ return parent::_prepareForm();
91
+ }
92
+ }
app/code/community/MSP/CashOnDelivery/Block/Admin/Rule/Grid.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Block_Admin_Rule_Grid extends Mage_Adminhtml_Block_Widget_Grid
22
+ {
23
+ protected $zoneType = null;
24
+
25
+ public function _construct()
26
+ {
27
+ parent::_construct();
28
+ $this->zoneType = Mage::registry('msp_cashondelivery_zone');
29
+ $this->setId('cashondeliveryGrid');
30
+ $this->_controller = 'msp_cashondelivery';
31
+ }
32
+
33
+ protected function _prepareCollection()
34
+ {
35
+ $model = Mage::getModel('msp_cashondelivery/'.$this->zoneType);
36
+ $collection = $model->getCollection();
37
+ $this->setCollection($collection);
38
+
39
+ $this->setDefaultSort('amount_from');
40
+ $this->setDefaultDir('ASC');
41
+ $this->setSaveParametersInSession(true);
42
+
43
+ return parent::_prepareCollection();
44
+ }
45
+
46
+ protected function _prepareColumns()
47
+ {
48
+ $this->addColumn('id', array(
49
+ 'header' => Mage::helper('msp_cashondelivery')->__('ID'),
50
+ 'align' => 'right',
51
+ 'width' => '50px',
52
+ 'index' => 'msp_cashondelivery_'.$this->zoneType.'_id',
53
+ ));
54
+
55
+ $this->addColumn('from', array(
56
+ 'header' => Mage::helper('msp_cashondelivery')->__('From amount'),
57
+ 'align' => 'left',
58
+ 'index' => 'amount_from',
59
+ 'type' => 'currency',
60
+ 'truncate' => 50,
61
+ 'escape' => true,
62
+ ));
63
+
64
+ $this->addColumn('fixed_fee', array(
65
+ 'header' => Mage::helper('msp_cashondelivery')->__('Fixed Fee'),
66
+ 'align' => 'left',
67
+ 'index' => 'fixed_fee',
68
+ 'type' => 'currency',
69
+ 'truncate' => 30,
70
+ 'escape' => true,
71
+ ));
72
+
73
+ $this->addColumn('percent_fee', array(
74
+ 'header' => Mage::helper('msp_cashondelivery')->__('Percentual Fee'),
75
+ 'align' => 'left',
76
+ 'index' => 'percent_fee',
77
+ 'type' => 'currency',
78
+ 'truncate' => 30,
79
+ 'escape' => true,
80
+ ));
81
+
82
+ $this->addColumn('action',
83
+ array(
84
+ 'header' => Mage::helper('msp_cashondelivery')->__('Action'),
85
+ 'width' => '100px',
86
+ 'type' => 'action',
87
+ 'getter' => 'getId',
88
+ 'actions' => array(array(
89
+ 'caption' => Mage::helper('msp_cashondelivery')->__('Edit'),
90
+ 'url' => array(
91
+ 'base'=>'*/*/edit'
92
+ ),
93
+ 'field' => 'id'
94
+ )),
95
+ 'filter' => false,
96
+ 'sortable' => false,
97
+ 'index' => 'msp_cashondelivery',
98
+ ));
99
+
100
+ return parent::_prepareColumns();
101
+ }
102
+
103
+ public function getRowUrl($row)
104
+ {
105
+ return $this->getUrl('*/*/edit', array(
106
+ 'id' => $row->getId(),
107
+ ));
108
+ }
109
+ }
app/code/community/MSP/CashOnDelivery/Block/Form.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Block_Form extends Mage_Payment_Block_Form
22
+ {
23
+ protected $_order;
24
+ protected $_quote;
25
+
26
+ protected function getSession()
27
+ {
28
+ if (Mage::getDesign()->getArea() == 'adminhtml')
29
+ return Mage::getSingleton('adminhtml/session_quote');
30
+
31
+ return Mage::getSingleton('checkout/session');
32
+ }
33
+
34
+ protected function _construct()
35
+ {
36
+ parent::_construct();
37
+ $this->setTemplate('msp_cashondelivery/form.phtml');
38
+ }
39
+
40
+ protected function getOrder()
41
+ {
42
+ if ($this->_order)
43
+ return $this->_order;
44
+
45
+ $this->_order = Mage::getModel('sales/order');
46
+ $this->_order->loadByIncrementId($this->getSession()->getLastRealOrderId());
47
+
48
+ return $this->_order;
49
+ }
50
+
51
+ protected function getQuote()
52
+ {
53
+ if ($this->_quote)
54
+ return $this->_quote;
55
+
56
+ $this->_quote = $this->getSession()->getQuote();
57
+
58
+ return $this->_quote;
59
+ }
60
+ }
app/code/community/MSP/CashOnDelivery/Block/Sales/Order/Total.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Block_Sales_Order_Total extends Mage_Sales_Block_Order_Totals
22
+ {
23
+ public function initTotals(){
24
+ $order = $this->getParentBlock()->getOrder();
25
+ if($order->getMspCashondelivery() > 0){
26
+ $this->getParentBlock()->addTotal(new Varien_Object(array(
27
+ 'code' => 'msp_cashondelivery',
28
+ 'value' => $order->getMspCashondelivery(),
29
+ 'base_value' => $order->getMspBaseCashondelivery(),
30
+ 'label' => 'Cash On Delivery',
31
+ )),'subtotal');
32
+ }
33
+ }
34
+ }
app/code/community/MSP/CashOnDelivery/COMPATIBILITY.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ This file reports the compatibility table for this extension.
2
+ If your Magento version is not included in this list you may try
3
+ using the extension but AT YOUR OWN RISK.
4
+
5
+ CE 1.5.0
6
+ CE 1.5.1
7
+ CE 1.6.0
8
+ CE 1.6.1
9
+ CE 1.6.2
10
+ CE 1.7.x
app/code/community/MSP/CashOnDelivery/Helper/Data.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Helper_Data extends Mage_Core_Helper_Abstract
22
+ {
23
+ const XML_PATH_GENERAL_ENABLED = 'msp_cashondelivery/general/enabled';
24
+ const XML_PATH_GENERAL_CALC_INC_SHIP = 'payment/msp_cashondelivery/calc_including_shipping';
25
+ const XML_PATH_GENERAL_CALC_INC_TAX = 'payment/msp_cashondelivery/calc_including_taxes';
26
+ const XML_PATH_STANDARD_FEE_LOCAL = 'payment/msp_cashondelivery/standard_fixed_fee_local';
27
+ const XML_PATH_STANDARD_FEE_FOREIGN = 'payment/msp_cashondelivery/standard_fixed_fee_foreign';
28
+ const XML_PATH_SHIPPING_COUNTRY_ID = 'shipping/origin/country_id';
29
+ const XML_PATH_DESCRIPTION = 'payment/msp_cashondelivery/cod_description';
30
+
31
+ const MSP_COD_LOCAL = 'local';
32
+ const MSP_COD_FOREIGN = 'foreign';
33
+
34
+
35
+ /**
36
+ * Check if personal catalog is enabled
37
+ * @return boolean
38
+ */
39
+ public function getIsEnabled()
40
+ {
41
+ return (bool) Mage::getStoreConfig(self::XML_PATH_GENERAL_ENABLED);
42
+ }
43
+ public function isEnabled()
44
+ {
45
+ return $this->getIsEnabled();
46
+ }
47
+
48
+ /**
49
+ * Check if must include shipping in subtotal calculation
50
+ * @return boolean
51
+ */
52
+ public function getCalculateIncludingShipping()
53
+ {
54
+ return (bool) Mage::getStoreConfig(self::XML_PATH_GENERAL_CALC_INC_SHIP);
55
+ }
56
+
57
+ /**
58
+ * Check if must include taxes in subtotal calculation
59
+ * @return boolean
60
+ */
61
+ public function getCalculateIncludingTaxes()
62
+ {
63
+ return (bool) Mage::getStoreConfig(self::XML_PATH_GENERAL_CALC_INC_TAX);
64
+ }
65
+
66
+
67
+ /**
68
+ * Get currenct checkout/admin session
69
+ *
70
+ * @return Varien_Object
71
+ */
72
+ public function getSession()
73
+ {
74
+ if (Mage::app()->getStore()->isAdmin())
75
+ return Mage::getSingleton('adminhtml/session_quote');
76
+
77
+ return Mage::getSingleton('checkout/session');
78
+ }
79
+
80
+ /**
81
+ * Get current quote
82
+ *
83
+ * @return Mage_Sales_Model_Quote
84
+ */
85
+ public function getQuote()
86
+ {
87
+ return $this->getSession()->getQuote();
88
+ }
89
+
90
+ public function getCodDescription($storeId = null) {
91
+ return Mage::getStoreConfig(self::XML_PATH_DESCRIPTION, $storeId);
92
+ }
93
+
94
+ public function getZoneType() {
95
+ $_quote = $this->getQuote();
96
+ $_shippingAddress = $_quote->getShippingAddress();
97
+ $_storeId = $_quote->getStoreId();
98
+ return $_shippingAddress->getCountryId() == $this->getShippingCountryId($_storeId) ? self::MSP_COD_LOCAL : self::MSP_COD_FOREIGN;
99
+ }
100
+
101
+ public function getStandardFixedFee($storeId = null)
102
+ {
103
+ if ($this->getZoneType() == self::MSP_COD_LOCAL)
104
+ return (float)Mage::getStoreConfig(self::XML_PATH_STANDARD_FEE_LOCAL, $storeId);
105
+ else
106
+ return (float)Mage::getStoreConfig(self::XML_PATH_STANDARD_FEE_FOREIGN, $storeId);
107
+ }
108
+
109
+ public function getShippingCountryId($storeId = null) {
110
+ return Mage::getStoreConfig(self::XML_PATH_SHIPPING_COUNTRY_ID, $storeId);
111
+ }
112
+
113
+ public function currencyConvert($amount) {
114
+ $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
115
+ $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
116
+
117
+ return Mage::helper('directory')->currencyConvert($amount, $baseCurrencyCode, $currentCurrencyCode);
118
+ }
119
+
120
+ }
app/code/community/MSP/CashOnDelivery/LICENSE.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ IDEALIAGroup srl
2
+
3
+ NOTICE OF LICENSE
4
+
5
+ This source file is subject to the Open Software License (OSL 3.0)
6
+ that is bundled with this package in the file LICENSE.txt.
7
+ It is also available through the world-wide-web at this URL:
8
+ http://opensource.org/licenses/osl-3.0.php
9
+ If you did not receive a copy of the license and are unable to
10
+ obtain it through the world-wide-web, please send an email
11
+ to info@idealiagroup.com so we can send you a copy immediately.
app/code/community/MSP/CashOnDelivery/Model/Cashondelivery.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Model_Cashondelivery extends Mage_Payment_Model_Method_Abstract
22
+ {
23
+ protected $_code = 'msp_cashondelivery';
24
+ protected $_paymentMethod = 'msp_cashondelivery';
25
+ protected $_formBlockType = 'msp_cashondelivery/form';
26
+
27
+ protected $_isGateway = false;
28
+ protected $_canAuthorize = true;
29
+ protected $_canCapture = false;
30
+ protected $_canCapturePartial = false;
31
+ protected $_canRefund = false;
32
+ protected $_canVoid = true;
33
+ protected $_canUseInternal = true;
34
+ protected $_canUseCheckout = true;
35
+ protected $_canUseForMultishipping = true;
36
+
37
+ public function getExtraFee() {
38
+ $_helper = Mage::helper('msp_cashondelivery');
39
+ $_quote = Mage::getModel('sales/quote')->load($_helper->getQuote()->getId());
40
+ // get subtotal depending on options
41
+ if ($_helper->getCalculateIncludingShipping())
42
+ $_subTotal = $_quote->getBaseGrandTotal();
43
+ else
44
+ $_subTotal = $_quote->getBaseSubtotal();
45
+
46
+
47
+ // get the correct apply rule
48
+ $applyRule = $this->getApplyRule($_helper->getZoneType(), $_subTotal);
49
+
50
+ $standardFixedFee = $_helper->getStandardFixedFee();
51
+ $fixedFee = $applyRule->getFixedFee();
52
+ $percentFee = (float)$applyRule->getPercentFee();
53
+
54
+ $extraFee = $standardFixedFee + $fixedFee + $percentFee * $_subTotal /100;
55
+
56
+ return $extraFee;
57
+ }
58
+
59
+ protected function getApplyRule($zoneType, $subTotal) {
60
+ $collection = Mage::getResourceModel('msp_cashondelivery/'.$zoneType.'_collection');
61
+ $collection
62
+ ->addFieldToFilter('amount_from', array('lteq' => $subTotal));
63
+ $collection->getSelect()->order('amount_from DESC')->limit(1);
64
+
65
+ return $collection->getFirstItem();
66
+ }
67
+ }
app/code/community/MSP/CashOnDelivery/Model/Foreign.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Model_Foreign extends Mage_Core_Model_Abstract
22
+ {
23
+ const EXCEPTION_AMOUNT_FROM_EXISTS = 23000;
24
+
25
+ public function _construct()
26
+ {
27
+ parent::_construct();
28
+ $this->_init('msp_cashondelivery/foreign');
29
+ }
30
+ }
app/code/community/MSP/CashOnDelivery/Model/Local.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Model_Local extends Mage_Core_Model_Abstract
22
+ {
23
+ const EXCEPTION_AMOUNT_FROM_EXISTS = 23000;
24
+
25
+ public function _construct()
26
+ {
27
+ parent::_construct();
28
+ $this->_init('msp_cashondelivery/local');
29
+ }
30
+ }
app/code/community/MSP/CashOnDelivery/Model/Mysql4/Foreign.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Model_Mysql4_Foreign extends Mage_Core_Model_Mysql4_Abstract
22
+ {
23
+ public function _construct()
24
+ {
25
+ $this->_init('msp_cashondelivery/foreign', 'msp_cashondelivery_foreign_id');
26
+ }
27
+ }
app/code/community/MSP/CashOnDelivery/Model/Mysql4/Foreign/Collection.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Model_Mysql4_Foreign_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
22
+ {
23
+ public function _construct()
24
+ {
25
+ $this->_init('msp_cashondelivery/foreign');
26
+ }
27
+ }
app/code/community/MSP/CashOnDelivery/Model/Mysql4/Local.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Model_Mysql4_Local extends Mage_Core_Model_Mysql4_Abstract
22
+ {
23
+ public function _construct()
24
+ {
25
+ $this->_init('msp_cashondelivery/local', 'msp_cashondelivery_local_id');
26
+ }
27
+ }
app/code/community/MSP/CashOnDelivery/Model/Mysql4/Local/Collection.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Model_Mysql4_Local_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
22
+ {
23
+ public function _construct()
24
+ {
25
+ $this->_init('msp_cashondelivery/local');
26
+ }
27
+ }
app/code/community/MSP/CashOnDelivery/Model/Order/Pdf/Total/Default.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ class MSP_CashOnDelivery_Model_Order_Pdf_Total_Default extends Mage_Sales_Model_Order_Pdf_Total_Default
21
+ {
22
+ public function getTotalsForDisplay(){
23
+ $amount = $this->getOrder()->getMspCashondelivery();
24
+ $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
25
+ if(floatval($amount)){
26
+ $amount = $this->getOrder()->formatPriceTxt($amount);
27
+ if ($this->getAmountPrefix()){
28
+ $discount = $this->getAmountPrefix().$discount;
29
+ }
30
+ $totals = array(array(
31
+ 'label' => 'Cash On Delivery',
32
+ 'amount' => $amount,
33
+ 'font_size' => $fontSize,
34
+ )
35
+ );
36
+ return $totals;
37
+ }
38
+ }
39
+
40
+ public function canDisplay() {
41
+ return $this->getOrder()->getMspCashondelivery() > 0;
42
+ }
43
+ }
app/code/community/MSP/CashOnDelivery/Model/Order/Total.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Model_Order_Total extends Mage_Sales_Model_Order_Invoice_Total_Abstract
22
+ {
23
+ public function collect(Mage_Sales_Model_Order_Invoice $invoice)
24
+ {
25
+ $order = $invoice->getOrder();
26
+
27
+ $amount = $order->getMspCashondelivery();
28
+ $baseAmount = $order->getMspBaseCashondelivery();
29
+
30
+ $invoice->setGrandTotal($invoice->getGrandTotal() + $amount);
31
+ $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $baseAmount);
32
+
33
+ $invoice->setMspCashondelivery($premium);
34
+ $invoice->setMspBaseCashondelivery($basePremium);
35
+
36
+ return $this;
37
+
38
+ }
39
+ }
app/code/community/MSP/CashOnDelivery/Model/Quote/Total.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Model_Quote_Total extends Mage_Sales_Model_Quote_Address_Total_Abstract
22
+ {
23
+ protected $_code = 'msp_cashondelivery';
24
+
25
+ public function collect(Mage_Sales_Model_Quote_Address $address)
26
+ {
27
+ parent::collect($address);
28
+ $_helper = Mage::helper('msp_cashondelivery');
29
+ $_model = Mage::getModel('msp_cashondelivery/cashondelivery');
30
+ $quote = $address->getQuote();
31
+ $baseAmount = $_model->getExtraFee();
32
+ $amount = $_helper->currencyConvert($baseAmount);
33
+
34
+ if (
35
+ ($_helper->getQuote()->getPayment()->getMethod() == $_model->getCode()) &&
36
+ ($address->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_SHIPPING)
37
+ ) {
38
+ $this->_addAmount($amount);
39
+ $this->_addBaseAmount($baseAmount);
40
+ $address->setMspCashondelivery($amount);
41
+ $address->setMspBaseCashondelivery($baseAmount);
42
+ $quote->setMspCashondelivery($amount);
43
+ $quote->setMspBaseCashondelivery($baseAmount);
44
+ }
45
+
46
+ return $this;
47
+ }
48
+
49
+ public function fetch(Mage_Sales_Model_Quote_Address $address)
50
+ {
51
+ parent::fetch($address);
52
+ $_helper = Mage::helper('msp_cashondelivery');
53
+ $_model = Mage::getModel('msp_cashondelivery/cashondelivery');
54
+
55
+ $amount = $_model->getExtraFee();
56
+
57
+ if ($amount > 0 &&
58
+ ($_helper->getQuote()->getPayment()->getMethod() == $_model->getCode()) &&
59
+ ($address->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_SHIPPING)
60
+ ) {
61
+ $address->addTotal(array(
62
+ 'code' => $this->getCode(),
63
+ 'title' => $_helper->__('Cash On Delivery'),
64
+ 'value' => $amount,
65
+ ));
66
+ }
67
+
68
+ return $this;
69
+ }
70
+
71
+ /**
72
+ * Get Subtotal label
73
+ *
74
+ * @return string
75
+ */
76
+ public function getLabel()
77
+ {
78
+ return Mage::helper('msp_cashondelivery')->__('Cash On Delivery');
79
+ }
80
+ }
app/code/community/MSP/CashOnDelivery/controllers/Adminhtml/Cashondelivery/ForeignController.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ require_once(BP.DS.'app'.DS.'code'.DS.'community'.DS.'MSP'.DS.'CashOnDelivery'.DS.'controllers'.DS.'Adminhtml'.DS.'CashondeliveryController.php');
22
+ class MSP_CashOnDelivery_Adminhtml_Cashondelivery_ForeignController extends MSP_CashOnDelivery_Adminhtml_CashondeliveryController
23
+ {
24
+ protected $zoneType='foreign';
25
+ }
app/code/community/MSP/CashOnDelivery/controllers/Adminhtml/Cashondelivery/LocalController.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ require_once(BP.DS.'app'.DS.'code'.DS.'community'.DS.'MSP'.DS.'CashOnDelivery'.DS.'controllers'.DS.'Adminhtml'.DS.'CashondeliveryController.php');
22
+ class MSP_CashOnDelivery_Adminhtml_Cashondelivery_LocalController extends MSP_CashOnDelivery_Adminhtml_CashondeliveryController
23
+ {
24
+ protected $zoneType='local';
25
+ }
app/code/community/MSP/CashOnDelivery/controllers/Adminhtml/CashondeliveryController.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class MSP_CashOnDelivery_Adminhtml_CashondeliveryController extends Mage_Adminhtml_Controller_Action
22
+ {
23
+ protected $zoneType='';
24
+ public function indexAction()
25
+ {
26
+ Mage::register('msp_cashondelivery_zone', $this->zoneType);
27
+ if (!$this->zoneType) {
28
+ $this->norouteAction(); return;
29
+ }
30
+ $this->loadLayout()
31
+ ->_addContent($this->getLayout()->createBlock('msp_cashondelivery/admin_rule'))
32
+ ->renderLayout();
33
+ }
34
+
35
+ public function newAction()
36
+ {
37
+ if (!$this->zoneType) {
38
+ $this->norouteAction(); return;
39
+ }
40
+
41
+ $this->_forward('edit');
42
+ }
43
+
44
+ public function editAction()
45
+ {
46
+ if (!$this->zoneType) {
47
+ $this->norouteAction(); return;
48
+ }
49
+
50
+ $id = $this->getRequest()->getParam('id');
51
+ $model = Mage::getModel('msp_cashondelivery/'.$this->zoneType)->load($id);
52
+ if ($model->getId() || $id == 0)
53
+ {
54
+ Mage::register('msp_cashondelivery_zone', $this->zoneType);
55
+ Mage::register('msp_cashondelivery_data', $model);
56
+
57
+ $this->loadLayout();
58
+ $this->_addContent($this->getLayout()->createBlock('msp_cashondelivery/admin_rule_edit'));
59
+ $this->renderLayout();
60
+ }
61
+ else
62
+ {
63
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('msp_cashondelivery')->__('Item does not exist'));
64
+ $this->_redirect('*/*/index');
65
+ }
66
+ }
67
+
68
+ public function saveAction()
69
+ {
70
+ if (!$this->zoneType) {
71
+ $this->norouteAction(); return;
72
+ }
73
+
74
+ if ($this->getRequest()->getPost())
75
+ {
76
+ try
77
+ {
78
+ $postData = $this->getRequest()->getPost();
79
+ $model = Mage::getModel('msp_cashondelivery/'.$this->zoneType);
80
+
81
+ $model->setId($this->getRequest()->getParam('id'))
82
+ ->setAmountFrom($postData['amount_from'])
83
+ ->setFixedFee($postData['fixed_fee'])
84
+ ->setPercentFee($postData['percent_fee'])
85
+ ->save();
86
+
87
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Rule was successfully saved'));
88
+ Mage::getSingleton('adminhtml/session')->setCashOndeliveryLocalData(false);
89
+
90
+ $this->_redirect('*/*/index');
91
+ return;
92
+ } catch (Exception $e) {
93
+ if ($e->getCode() === constant(get_class($model).'::EXCEPTION_AMOUNT_FROM_EXISTS'))
94
+ $message = $this->__('This rule already exists, please select another amount');
95
+ else
96
+ $message = $e->getMessage();
97
+ Mage::getSingleton('adminhtml/session')->addError($message);
98
+ Mage::getSingleton('adminhtml/session')->setCashOndeliveryLocalData($this->getRequest()->getPost());
99
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
100
+ return;
101
+ }
102
+ }
103
+
104
+ $this->_redirect('*/*/index');
105
+ }
106
+
107
+ public function deleteAction()
108
+ {
109
+ if (!$this->zoneType) {
110
+ $this->norouteAction(); return;
111
+ }
112
+
113
+ if ($this->getRequest()->getParam('id') > 0)
114
+ {
115
+ try
116
+ {
117
+ $model = Mage::getModel('msp_cashondelivery/'.$this->zoneType);
118
+
119
+ $model->setId($this->getRequest()->getParam('id'))->delete();
120
+
121
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
122
+ $this->_redirect('*/*/index');
123
+ }
124
+ catch (Exception $e)
125
+ {
126
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
127
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
128
+ }
129
+ }
130
+
131
+ $this->_redirect('*/*/index');
132
+ }
133
+ }
app/code/community/MSP/CashOnDelivery/etc/config.xml ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * IDEALIAGroup srl
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 info@idealiagroup.com so we can send you a copy immediately.
15
+ *
16
+ * @category MSP
17
+ * @package MSP_CashOnDelivery
18
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <config>
23
+ <modules>
24
+ <MSP_CashOnDelivery>
25
+ <version>1.0.0</version>
26
+ </MSP_CashOnDelivery>
27
+ </modules>
28
+
29
+ <global>
30
+ <helpers>
31
+ <msp_cashondelivery>
32
+ <class>MSP_CashOnDelivery_Helper</class>
33
+ </msp_cashondelivery>
34
+ </helpers>
35
+
36
+ <blocks>
37
+ <msp_cashondelivery>
38
+ <class>MSP_CashOnDelivery_Block</class>
39
+ </msp_cashondelivery>
40
+ </blocks>
41
+
42
+ <models>
43
+ <msp_cashondelivery>
44
+ <class>MSP_CashOnDelivery_Model</class>
45
+ <resourceModel>msp_cashondelivery_mysql4</resourceModel>
46
+ </msp_cashondelivery>
47
+
48
+ <msp_cashondelivery_mysql4>
49
+ <class>MSP_CashOnDelivery_Model_Mysql4</class>
50
+ <entities>
51
+ <local>
52
+ <table>msp_cashondelivery_local</table>
53
+ </local>
54
+ <foreign>
55
+ <table>msp_cashondelivery_foreign</table>
56
+ </foreign>
57
+ </entities>
58
+ </msp_cashondelivery_mysql4>
59
+ </models>
60
+
61
+ <resources>
62
+ <msp_cashondelivery_setup>
63
+ <setup>
64
+ <module>MSP_CashOnDelivery</module>
65
+ </setup>
66
+ <connection>
67
+ <use>core_setup</use>
68
+ </connection>
69
+ </msp_cashondelivery_setup>
70
+
71
+ <msp_cashondelivery_write>
72
+ <connection>
73
+ <use>core_write</use>
74
+ </connection>
75
+ </msp_cashondelivery_write>
76
+
77
+ <msp_cashondelivery_read>
78
+ <connection>
79
+ <use>core_read</use>
80
+ </connection>
81
+ </msp_cashondelivery_read>
82
+ </resources>
83
+
84
+ <sales>
85
+ <quote>
86
+ <totals>
87
+ <msp_cashondelivery>
88
+ <class>msp_cashondelivery/quote_total</class>
89
+ <after>grand_total</after>
90
+ </msp_cashondelivery>
91
+ </totals>
92
+ </quote>
93
+ <order_invoice>
94
+                <totals>
95
+                    <msp_cashondelivery>
96
+                       <class>msp_cashondelivery/order_total</class>
97
+                    </msp_cashondelivery>
98
+                </totals>
99
+            </order_invoice>           
100
+            <order_creditmemo>
101
+                <totals>
102
+                    <msp_cashondelivery>
103
+                       <class>msp_cashondelivery/order_total</class>
104
+                    </msp_cashondelivery>
105
+                </totals>
106
+            </order_creditmemo>
107
+ </sales>
108
+
109
+ <fieldsets>
110
+ <sales_convert_quote>
111
+ <msp_cashondelivery><to_quote>*</to_quote></msp_cashondelivery>
112
+ <msp_base_cashondelivery><to_quote>*</to_quote></msp_base_cashondelivery>
113
+ </sales_convert_quote>
114
+ <sales_convert_order>
115
+ <msp_cashondelivery><to_quote>*</to_quote></msp_cashondelivery>
116
+ <msp_base_cashondelivery><to_quote>*</to_quote></msp_base_cashondelivery>
117
+ </sales_convert_order>
118
+ <sales_convert_order_address>
119
+ <msp_cashondelivery><to_quote_address>*</to_quote_address></msp_cashondelivery>
120
+ <msp_base_cashondelivery><to_quote_address>*</to_quote_address></msp_base_cashondelivery>
121
+ </sales_convert_order_address>
122
+ <sales_convert_quote_address>
123
+ <msp_cashondelivery><to_quote>*</to_quote><to_order>*</to_order></msp_cashondelivery>
124
+ <msp_base_cashondelivery><to_quote>*</to_quote><to_order>*</to_order></msp_base_cashondelivery>
125
+ </sales_convert_quote_address>
126
+ </fieldsets>
127
+
128
+ <pdf>
129
+ <totals>
130
+ <msp_cashondelivery translate="title">
131
+ <title>Cash On Delivery</title>
132
+ <source_field>msp_cashondelivery</source_field>
133
+ <model>msp_cashondelivery/order_pdf_total_default</model>
134
+ <font_size>7</font_size>
135
+ <display_zero>0</display_zero>
136
+ <sort_order>251</sort_order>
137
+ </msp_cashondelivery>
138
+ </totals>
139
+ </pdf>
140
+ </global>
141
+
142
+ <adminhtml>
143
+ <translate>
144
+ <modules>
145
+ <msp_cashondelivery>
146
+ <files>
147
+ <default>MSP_CashOnDelivery.csv</default>
148
+ </files>
149
+ </msp_cashondelivery>
150
+ </modules>
151
+ </translate>
152
+ <menu>
153
+ <sales>
154
+ <children>
155
+ <msp_cashondelivery translate="title" module="msp_cashondelivery">
156
+ <title>Cash on delivery prices</title>
157
+ <sort_order>1000</sort_order>
158
+ <children>
159
+ <msp_cashondelivery_local translate="title" module="msp_cashondelivery">
160
+ <title>Local destinations</title>
161
+ <action>adminhtml/cashondelivery_local</action>
162
+ <sort_order>10</sort_order>
163
+ </msp_cashondelivery_local>
164
+ <msp_cashondelivery_foreign translate="title" module="msp_cashondelivery">
165
+ <title>Foreign destinations</title>
166
+ <action>adminhtml/cashondelivery_foreign</action>
167
+ <sort_order>20</sort_order>
168
+ </msp_cashondelivery_foreign>
169
+ </children>
170
+ </msp_cashondelivery>
171
+ </children>
172
+ </sales>
173
+ </menu>
174
+ <layout>
175
+ <updates>
176
+ <msp_cashondelivery>
177
+ <file>msp_cashondelivery.xml</file>
178
+ </msp_cashondelivery>
179
+ </updates>
180
+ </layout>
181
+ <translate>
182
+ <modules>
183
+ <msp_cashondelivery>
184
+ <files>
185
+ <default>MSP_CashOnDelivery.csv</default>
186
+ </files>
187
+ </msp_cashondelivery>
188
+ </modules>
189
+ </translate>
190
+ </adminhtml>
191
+
192
+ <frontend>
193
+ <layout>
194
+ <updates>
195
+ <msp_cashondelivery>
196
+ <file>msp_cashondelivery.xml</file>
197
+ </msp_cashondelivery>
198
+ </updates>
199
+ </layout>
200
+ <translate>
201
+ <modules>            
202
+ <msp_cashondelivery>                  
203
+ <files>           
204
+ <default>MSP_CashOnDelivery.csv</default>                
205
+ </files>
206
+ </msp_cashondelivery>
207
+ </modules>
208
+ </translate>
209
+ </frontend>
210
+     
211
+     <admin>
212
+         <routers>
213
+             <adminhtml>
214
+                 <args>
215
+                     <modules>
216
+                         <msp_cashondelivery before="Mage_Adminhtml">MSP_CashOnDelivery_Adminhtml</msp_cashondelivery>
217
+                     </modules>
218
+                 </args>
219
+             </adminhtml>
220
+         </routers>
221
+     </admin>
222
+
223
+ <default>
224
+ <msp_cashondelivery>
225
+ <general>
226
+ <enabled>1</enabled>
227
+ </general>
228
+ </msp_cashondelivery>
229
+ <payment>
230
+ <msp_cashondelivery>
231
+ <active>1</active>
232
+ <model>msp_cashondelivery/cashondelivery</model>
233
+ <order_status>pending</order_status>
234
+ <title>Cash on delivery</title>
235
+ <payment_action>authorize</payment_action>
236
+ <allowspecific>0</allowspecific>
237
+ <specificcountry>IT</specificcountry>
238
+ <calc_including_shipping>0</calc_including_shipping>
239
+ <calc_including_taxes>1</calc_including_taxes>
240
+ </msp_cashondelivery>
241
+ </payment>
242
+ <sales>
243
+ <totals_sort>
244
+ <msp_cashondelivery>1000</msp_cashondelivery>
245
+ <msp_cashondelivery_tax>1001</msp_cashondelivery_tax>
246
+ </totals_sort>
247
+ </sales>
248
+ </default>
249
+
250
+ </config>
app/code/community/MSP/CashOnDelivery/etc/system.xml ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * IDEALIAGroup srl
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 info@idealiagroup.com so we can send you a copy immediately.
15
+ *
16
+ * @category MSP
17
+ * @package MSP_CashOnDelivery
18
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <config>
23
+ <tabs>
24
+ <magespecialist translate="label" module="msp_cashondelivery">
25
+ <label>MageSpecialist.it</label>
26
+ <sort_order>200</sort_order>
27
+ </magespecialist>
28
+ </tabs>
29
+ <sections>
30
+ <sales>
31
+ <groups>
32
+ <totals_sort>
33
+ <fields>
34
+ <msp_cashondelivery translate="label">
35
+ <label>Cash On Delivery</label>
36
+ <frontend_type>text</frontend_type>
37
+ <sort_order>1000</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>1</show_in_website>
40
+ <show_in_store>0</show_in_store>
41
+ </msp_cashondelivery>
42
+ <msp_cashondelivery_tax translate="label">
43
+ <label>Cash On Delivery Taxes</label>
44
+ <frontend_type>text</frontend_type>
45
+ <sort_order>1001</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>0</show_in_store>
49
+ </msp_cashondelivery_tax>
50
+ </fields>
51
+ </totals_sort>
52
+ </groups>
53
+ </sales>
54
+ <payment>
55
+ <groups>
56
+ <msp_cashondelivery translate="label">
57
+ <label>Cash on delivery</label>
58
+ <sort_order>10</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ <fields>
63
+ <active translate="label">
64
+ <label>Enable Cash on delivery</label>
65
+ <frontend_type>select</frontend_type>
66
+ <source_model>adminhtml/system_config_source_yesno</source_model>
67
+ <sort_order>10</sort_order>
68
+ <show_in_default>1</show_in_default>
69
+ <show_in_website>1</show_in_website>
70
+ <show_in_store>0</show_in_store>
71
+ </active>
72
+ <title translate="label">
73
+ <label>Title</label>
74
+ <frontend_type>text</frontend_type>
75
+ <sort_order>20</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ </title>
80
+ <sort_order translate="label">
81
+ <label>Sort Order</label>
82
+ <frontend_type>text</frontend_type>
83
+ <sort_order>25</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>0</show_in_store>
87
+ </sort_order>
88
+ <cod_description translate="label">
89
+ <label>Description</label>
90
+ <frontend_type>textarea</frontend_type>
91
+ <comment>Additional text displayed on the payment method selection</comment>
92
+ <sort_order>70</sort_order>
93
+ <show_in_default>1</show_in_default>
94
+ <show_in_website>1</show_in_website>
95
+ <show_in_store>1</show_in_store>
96
+ </cod_description>
97
+ <order_status translate="label">
98
+ <label>New order status</label>
99
+ <frontend_type>select</frontend_type>
100
+ <source_model>adminhtml/system_config_source_order_status_processing</source_model>
101
+ <sort_order>80</sort_order>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>1</show_in_website>
104
+ <show_in_store>0</show_in_store>
105
+ </order_status>
106
+ <calc_including_shipping translate="label">
107
+ <label>Calculate subtotal including shipping</label>
108
+ <frontend_type>select</frontend_type>
109
+ <sort_order>90</sort_order>
110
+ <source_model>adminhtml/system_config_source_yesno</source_model>
111
+ <show_in_default>1</show_in_default>
112
+ <show_in_website>1</show_in_website>
113
+ <show_in_store>0</show_in_store>
114
+ </calc_including_shipping>
115
+ <calc_including_taxes translate="label">
116
+ <label>Calculate subtotal including taxes</label>
117
+ <frontend_type>select</frontend_type>
118
+ <sort_order>100</sort_order>
119
+ <source_model>adminhtml/system_config_source_yesno</source_model>
120
+ <show_in_default>1</show_in_default>
121
+ <show_in_website>1</show_in_website>
122
+ <show_in_store>0</show_in_store>
123
+ </calc_including_taxes>
124
+ <allowspecific translate="label">
125
+ <label>Payment from applicable countries</label>
126
+ <frontend_type>allowspecific</frontend_type>
127
+ <sort_order>110</sort_order>
128
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
129
+ <show_in_default>1</show_in_default>
130
+ <show_in_website>1</show_in_website>
131
+ <show_in_store>0</show_in_store>
132
+ </allowspecific>
133
+ <specificcountry translate="label">
134
+ <label>Payment from Specific countries</label>
135
+ <frontend_type>multiselect</frontend_type>
136
+ <sort_order>120</sort_order>
137
+ <source_model>adminhtml/system_config_source_country</source_model>
138
+ <show_in_default>1</show_in_default>
139
+ <show_in_website>1</show_in_website>
140
+ <show_in_store>0</show_in_store>
141
+ </specificcountry>
142
+ <standard_fixed_fee_local translate="label">
143
+ <label>Standard local fixed fee</label>
144
+ <frontend_type>text</frontend_type>
145
+ <sort_order>130</sort_order>
146
+ <show_in_default>1</show_in_default>
147
+ <show_in_website>1</show_in_website>
148
+ <show_in_store>0</show_in_store>
149
+ </standard_fixed_fee_local>
150
+ <standard_fixed_fee_foreign translate="label">
151
+ <label>Standard foreign fixed fee</label>
152
+ <frontend_type>text</frontend_type>
153
+ <sort_order>140</sort_order>
154
+ <show_in_default>1</show_in_default>
155
+ <show_in_website>1</show_in_website>
156
+ <show_in_store>0</show_in_store>
157
+ </standard_fixed_fee_foreign>
158
+ <min_order_total translate="label">
159
+ <label>Minimum Order Total</label>
160
+ <frontend_type>text</frontend_type>
161
+ <sort_order>150</sort_order>
162
+ <show_in_default>1</show_in_default>
163
+ <show_in_website>1</show_in_website>
164
+ <show_in_store>0</show_in_store>
165
+ </min_order_total>
166
+ <max_order_total translate="label">
167
+ <label>Maximum Order Total</label>
168
+ <frontend_type>text</frontend_type>
169
+ <sort_order>160</sort_order>
170
+ <show_in_default>1</show_in_default>
171
+ <show_in_website>1</show_in_website>
172
+ <show_in_store>0</show_in_store>
173
+ </max_order_total>
174
+ <credits>
175
+ <frontend_model>msp_common/adminhtml_system_config_fieldset_hint_credits</frontend_model>
176
+ <sort_order>999</sort_order>
177
+ <show_in_default>1</show_in_default>
178
+ <show_in_website>1</show_in_website>
179
+ <show_in_store>1</show_in_store>
180
+ </credits>
181
+ </fields>
182
+ </msp_cashondelivery>
183
+ </groups>
184
+ </payment>
185
+
186
+ </sections>
187
+ </config>
app/code/community/MSP/CashOnDelivery/sql/msp_cashondelivery_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_PersonalCatalog
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ $installer = $this;
22
+ $installer->startSetup();
23
+ $installer->run("
24
+ DROP TABLE IF EXISTS {$this->getTable('msp_cashondelivery_local')};
25
+ CREATE TABLE {$this->getTable('msp_cashondelivery_local')} (
26
+ `msp_cashondelivery_local_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
27
+ `amount_from` float NOT NULL,
28
+ `fixed_fee` float NOT NULL,
29
+ `percent_fee` float NOT NULL,
30
+ PRIMARY KEY (`msp_cashondelivery_local_id`)
31
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
32
+ ");
33
+ $installer->run("
34
+ DROP TABLE IF EXISTS {$this->getTable('msp_cashondelivery_foreign')};
35
+ CREATE TABLE {$this->getTable('msp_cashondelivery_foreign')} (
36
+ `msp_cashondelivery_foreign_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
37
+ `amount_from` float NOT NULL,
38
+ `fixed_fee` float NOT NULL,
39
+ `percent_fee` float NOT NULL,
40
+ PRIMARY KEY (`msp_cashondelivery_foreign_id`)
41
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
42
+ ");
43
+
44
+ $setup = new Mage_Sales_Model_Mysql4_Setup('core_setup');
45
+ $setup->startSetup();
46
+ $setup->addAttribute('invoice', 'msp_base_cashondelivery', array('type' => 'decimal', 'visible' => false, 'required' => true));
47
+ $setup->addAttribute('invoice', 'msp_cashondelivery', array('type' => 'decimal', 'visible' => false, 'required' => true));
48
+ $setup->addAttribute('order', 'msp_base_cashondelivery', array('type' => 'decimal', 'visible' => false, 'required' => true));
49
+ $setup->addAttribute('order', 'msp_cashondelivery', array('type' => 'decimal', 'visible' => false, 'required' => true));
50
+ $setup->addAttribute('quote', 'msp_base_cashondelivery', array('type' => 'decimal', 'visible' => false, 'required' => true));
51
+ $setup->addAttribute('quote', 'msp_cashondelivery', array('type' => 'decimal', 'visible' => false, 'required' => true));
52
+ $setup->addAttribute('order_address', 'msp_base_cashondelivery', array('type' => 'decimal', 'visible' => false, 'required' => true));
53
+ $setup->addAttribute('order_address', 'msp_cashondelivery', array('type' => 'decimal', 'visible' => false, 'required' => true));
54
+ $setup->addAttribute('quote_address', 'msp_base_cashondelivery', array('type' => 'decimal', 'visible' => false, 'required' => true));
55
+ $setup->addAttribute('quote_address', 'msp_cashondelivery', array('type' => 'decimal', 'visible' => false, 'required' => true));
56
+ $setup->endSetup();
57
+
58
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/msp_cashondelivery.xml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * IDEALIAGroup srl
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 info@idealiagroup.com so we can send you a copy immediately.
15
+ *
16
+ * @category MSP
17
+ * @package MSP_PersonalCatalog
18
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <layout>
23
+ <adminhtml_sales_order_view>
24
+ <reference name="order_totals">
25
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
26
+ </reference>
27
+ </adminhtml_sales_order_view>
28
+
29
+ <adminhtml_sales_order_invoice_new>
30
+ <reference name="invoice_totals">
31
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
32
+ </reference>
33
+ </adminhtml_sales_order_invoice_new>
34
+
35
+ <adminhtml_sales_order_invoice_view>
36
+ <reference name="invoice_totals">
37
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
38
+ </reference>
39
+ </adminhtml_sales_order_invoice_view>
40
+
41
+ <adminhtml_sales_order_creditmemo_new>
42
+ <reference name="creditmemo_totals">
43
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
44
+ </reference>
45
+ </adminhtml_sales_order_creditmemo_new>
46
+ <adminhtml_sales_order_creditmemo_view>
47
+ <reference name="creditmemo_totals">
48
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
49
+ </reference>
50
+ </adminhtml_sales_order_creditmemo_view>
51
+ </layout>
app/design/adminhtml/default/default/template/msp_cashondelivery/form.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ $_code = $this->getMethodCode();
22
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
23
+
24
+ $_extraFee = Mage::helper('core')->currency($this->getMethod()->getExtraFee());
25
+ ?>
26
+ <ul id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none">
27
+ <li>
28
+ <?php echo $this->__('You will be charged an extra fee of %s', $_extraFee) ?>
29
+ </li>
30
+ </ul>
app/design/frontend/base/default/layout/msp_cashondelivery.xml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * IDEALIAGroup srl
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 info@idealiagroup.com so we can send you a copy immediately.
15
+ *
16
+ * @category MSP
17
+ * @package MSP_PersonalCatalog
18
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <layout>
23
+ <sales_order_view>
24
+ <reference name="order_totals">
25
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
26
+ </reference>
27
+ </sales_order_view>
28
+ <sales_order_print>
29
+ <reference name="order_totals">
30
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
31
+ </reference>
32
+ </sales_order_print>
33
+ <sales_order_invoice>
34
+ <reference name="invoice_totals">
35
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
36
+ </reference>
37
+ </sales_order_invoice>
38
+ <sales_order_printinvoice>
39
+ <reference name="invoice_totals">
40
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
41
+ </reference>
42
+ </sales_order_printinvoice>
43
+ <sales_order_creditmemo>
44
+ <reference name="creditmemo_totals">
45
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
46
+ </reference>
47
+ </sales_order_creditmemo>
48
+ <sales_order_printcreditmemo>
49
+ <reference name="creditmemo_totals">
50
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
51
+ </reference>
52
+ </sales_order_printcreditmemo>
53
+ <sales_email_order_items>
54
+ <reference name="order_totals">
55
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
56
+ </reference>
57
+ </sales_email_order_items>
58
+ <sales_email_order_invoice_items>
59
+ <reference name="invoice_totals">
60
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
61
+ </reference>
62
+ </sales_email_order_invoice_items>
63
+ <sales_email_order_creditmemo_items>
64
+ <reference name="creditmemo_totals">
65
+ <block type="msp_cashondelivery/sales_order_total" name="msp_cashondelivery" />
66
+ </reference>
67
+ </sales_email_order_creditmemo_items>
68
+ </layout>
app/design/frontend/base/default/template/msp_cashondelivery/form.phtml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@idealiagroup.com so we can send you a copy immediately.
14
+ *
15
+ * @category MSP
16
+ * @package MSP_CashOnDelivery
17
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ $_code = $this->getMethodCode();
22
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
23
+
24
+ $_extraFee = Mage::helper('core')->currency($this->getMethod()->getExtraFee());
25
+ $_description = $this->getMethod()->getCodDescription();
26
+ ?>
27
+ <fieldset class="form-list">
28
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
29
+ <li>
30
+ <?php echo $_description ?>
31
+ <?php echo $this->__('You will be charged an extra fee of %s', $_extraFee) ?>
32
+ </li>
33
+ </ul>
34
+ </fieldset>
app/etc/modules/MSP_CashOnDelivery.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * IDEALIAGroup srl
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 info@idealiagroup.com so we can send you a copy immediately.
15
+ *
16
+ * @category MSP
17
+ * @package MSP_CashOnDelivery
18
+ * @copyright Copyright (c) 2013 IDEALIAGroup srl (http://www.idealiagroup.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <config>
23
+ <modules>
24
+ <MSP_CashOnDelivery>
25
+ <active>true</active>
26
+ <codePool>community</codePool>
27
+ <depends>
28
+ <MSP_Common/>
29
+ </depends>
30
+ </MSP_CashOnDelivery>
31
+ </modules>
32
+ </config>
app/locale/it_IT/MSP_CashOnDelivery.csv ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Cash on delivery prices","Prezzi contrassegno"
2
+ "Local destinations","Destinazioni nazionali"
3
+ "Foreign destinations","Destinazioni estere"
4
+ "Cash on delivery","Contrassegno"
5
+ "Enable Cash on delivery","Attiva contrassegno"
6
+ "MSP Cash on delivery prices - Local fee","MSP prezzi contrassegno - Importo nazionale"
7
+ "Add New Price Rule","Aggiungi nuova regola prezzo"
8
+ "MSP Cash on delivery prices - Foreign fee","MSP prezzi contrassegno - Importo estero"
9
+ "From amount","Importo a partire da"
10
+ "Apply fee","Applica prezzo"
11
+ "Apply from amount","Applica a partire dall'importo"
12
+ "Cash on delivery fee","Prezzo contrassegno"
13
+ "You will be charged an extra fee of %s","Il servizio prevede un costo addizionale di %s"
14
+ "Fee Amount","Prezzo aggiuntivo"
15
+ "Apply","Applica"
16
+ "Cash On Delivery", "Contrassegno"
17
+ "Cash on Delivery - %s (%d%%)","Contrassegno - %s (%d%%)"
18
+ "Cash on Delivery Tax (%d%%)","IVA sul constrassegno (%d%%)"
19
+ "Cash on Delivery Taxes","Tassazione contrassegno"
20
+ "Cash On Delivery Taxes","Tassazione contrassegno"
21
+ "Tax Class for Cash On Delivery","Classe di tassazione del Contrassegno"
22
+ "Display Cash On Delivery Amount","Mostra l'importo del contrassegno"
23
+ "This rule already exists, please select another amount","Questa regola è già stata inserita, selezionare un altro importo"
24
+ "Fixed Fee","Importo Fisso"
25
+ "Percentual Fee","Importo Percentuale"
26
+ "Rule was successfully saved","Regola prezzo salvata"
27
+ "Add Rule","Aggiungi regola prezzo"
28
+ "Edit Rule","Modifica regola prezzo"
29
+ "Standard local fixed fee", "Importo nazionale fisso standard "
30
+ "Standard foreign fixed fee", "Importo estero fisso standard"
31
+ "Calculate subtotal including shipping","Calcola il subtotale includendo la spedizione"
32
+ "Calculate subtotal including taxes","Calcola il subtotale includendo le tasse"
33
+ "Additional text displayed on the payment method selection","Testo aggiuntivo da mostrare nella selezione del pagamento"
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>MSP_CashOnDelivery</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>MagenoSpecialist CashOnDelivery module</summary>
10
+ <description>An easy to use module to add a fully configurable Cash On Delivery payment mode in your Magento store.</description>
11
+ <notes>Enjoy it ;)</notes>
12
+ <authors><author><name>Riccardo Tempesta</name><user>idealiagroup</user><email>tempesta@idealiagroup.com</email></author><author><name>Paolo Vecchiocattivi</name><user>idealiagroup</user><email>vecchiocattivi@idealiagroup.com</email></author></authors>
13
+ <date>2013-05-29</date>
14
+ <time>10:01:02</time>
15
+ <contents><target name="magecommunity"><dir name="MSP"><dir name="CashOnDelivery"><dir name="Block"><dir name="Admin"><dir name="Rule"><dir name="Edit"><file name="Form.php" hash="3ef514b316321a601b1414df18986c68"/></dir><file name="Edit.php" hash="16d02cedb6204fd7b831b5564f072d08"/><file name="Grid.php" hash="3588123b02fa04214defcfb7b09e1c51"/></dir><file name="Rule.php" hash="b933ae1daa5a7160d5bd27c75b20f3a6"/></dir><file name="Form.php" hash="1ed8f181beb6736ac9d481e6e622978f"/><dir name="Sales"><dir name="Order"><file name="Total.php" hash="c399bf6a6d9fed0b72bae2a253cc534f"/></dir></dir></dir><file name="COMPATIBILITY.txt" hash="b120e5821ccb687741d038f63cbd76c7"/><dir name="Helper"><file name="Data.php" hash="77d9d5093c34cff4bbbbcb22b0cd3ff5"/></dir><file name="LICENSE.txt" hash="43d8581f57722664f478fccb6e71f99b"/><dir name="Model"><file name="Cashondelivery.php" hash="41b74ad334f9f6b0f4f5f4effc38ba43"/><file name="Foreign.php" hash="a1582c07f33304b476d589349ab97a0e"/><file name="Local.php" hash="724831a475386d67793b41b3cf7ac302"/><dir name="Mysql4"><dir name="Foreign"><file name="Collection.php" hash="0a8c362e781a435a840f3a27bdb62e8b"/></dir><file name="Foreign.php" hash="186027f699b82cb3a84ff28ea00ae614"/><dir name="Local"><file name="Collection.php" hash="dcb52df5861f1e47c06580673da60b57"/></dir><file name="Local.php" hash="f364150b5cfc416601261f912e5af995"/></dir><dir name="Order"><dir name="Pdf"><dir name="Total"><file name="Default.php" hash="a5b1971b0d96ea083a8e3d27c0ab4666"/></dir></dir><file name="Total.php" hash="b8620df3c1bac6a89c3dc6ddc590656f"/></dir><dir name="Quote"><file name="Total.php" hash="d7856c70d7f07beae559ec200fd2b63a"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Cashondelivery"><file name="ForeignController.php" hash="d8ef1364e94f5c2ea492fee2ec2da84f"/><file name="LocalController.php" hash="c6e615ac1332e7d155d72f300b7c6fc6"/></dir><file name="CashondeliveryController.php" hash="b2d29ca215099171f926c15fcdd39e90"/></dir></dir><dir name="etc"><file name="config.xml" hash="d6e3c9032cf3abb19c0dbd5ae7f78d97"/><file name="system.xml" hash="39b7c98519671d69b794b538d36dc835"/></dir><dir name="sql"><dir name="msp_cashondelivery_setup"><file name="mysql4-install-1.0.0.php" hash="4f1f491964a4702bac27a00c6b634de1"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="msp_cashondelivery"><file name="form.phtml" hash="1534c81cc7d9478e221b6431770c6740"/></dir></dir><dir name="layout"><file name="msp_cashondelivery.xml" hash="1639e2df536b6fbb8066d9b59bc0c058"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="msp_cashondelivery"><file name="form.phtml" hash="be6ebdb094a5eaacbc565c17793af877"/></dir></dir><dir name="layout"><file name="msp_cashondelivery.xml" hash="9e0c45c81a9ccd35d1b12aa897eacfcf"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MSP_CashOnDelivery.xml" hash="d64644f02358bdbb7715c0bfab466582"/></dir></target><target name="magelocale"><dir name="it_IT"><file name="MSP_CashOnDelivery.csv" hash="7302d705c7c0101f0f657c8979924a5e"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>