Payment_Reembolso - Version 0.1.4

Version Notes

* Add translate file
* Adds different custom message

CHANGES:
->A app/locale/es_ES/Mage_Reembolso.csv
->U app/code/local/Mage/Reembolso/etc/system.xml
->U app/code/local/Mage/Reembolso/Model/Reembolso.php
->U app/code/local/Mage/Reembolso/etc/config.xml
->U app/design/frontend/default/default/template/reembolso/form.phtml
->U app/design/frontend/default/default/template/reembolso/info.phtml

Download this release

Release Info

Developer Magento Core Team
Extension Payment_Reembolso
Version 0.1.4
Comparing to
See all releases


Code changes from version 0.1.3 to 0.1.4

app/code/local/Mage/Reembolso/Helper/Data.php ADDED
@@ -0,0 +1,3 @@
1
+ <?php
2
+ class Mage_Reembolso_Helper_Data extends Mage_Core_Helper_Data {
3
+ }
app/code/local/Mage/Reembolso/Model/Quote.php CHANGED
@@ -3,21 +3,25 @@ class Mage_Reembolso_Model_Quote extends Mage_Sales_Model_Quote {
3
4
public function getAmount() {
5
$totals = parent::getTotals();
6
- $subtotal = $this->getSubTotalAmount(); //tomo el valor de la compra....
7
- //$totals['subtotal']->getData('value');
8
- $valores = Mage::getModel('reembolso/reembolso');
9
- $val = $valores->getValorTope(); //tomo el valor tope contra el cual comparar...
10
- if($subtotal < $val){
11
- if($valores->getValInfFix() == '1'){ //si el valor inferior es fijo.....
12
- $amount = $valores->getValorInferior();
13
- }else{ //si el velor inferior es porcentaje....
14
- $amount = ($subtotal * $valores->getValorInferior())/ 100;
15
}
16
} else {
17
if($valores->getValSupFix() == '1'){
18
- $amount = $valores->getValorSuperior();
19
}else{
20
- $amount = ($subtotal * $valores->getValorSuperior())/100;
21
}
22
}
23
return $amount;
3
4
public function getAmount() {
5
$totals = parent::getTotals();
6
+ // Tomo el valor de la compra....
7
+ $subtotal = $this->getSubTotalAmount();
8
+ $valores = Mage::getModel('reembolso/reembolso');
9
+
10
+ // Tomo el valor tope contra el cual comparar...
11
+ $val = $valores->getValorTope();
12
+ if($subtotal < $val){
13
+ // Si el valor inferior es fijo.....
14
+ if($valores->getValInfFix() == '1'){
15
+ $amount = $valores->getValorInferior();
16
+ // Si el velor inferior es porcentaje....
17
+ } else {
18
+ $amount = ($subtotal * $valores->getValorInferior()) / 100;
19
}
20
} else {
21
if($valores->getValSupFix() == '1'){
22
+ $amount = $valores->getValorSuperior();
23
}else{
24
+ $amount = ($subtotal * $valores->getValorSuperior()) /100;
25
}
26
}
27
return $amount;
app/code/local/Mage/Reembolso/Model/Reembolso.php CHANGED
@@ -6,38 +6,14 @@ class Mage_Reembolso_Model_Reembolso extends Mage_Payment_Model_Method_Abstract
6
protected $_formBlockType = 'reembolso/form';
7
protected $_infoBlockType = 'reembolso/info';
8
9
- public function getReembolsoTitle() {
10
- return $this->getConfigData('title');
11
}
12
-
13
- public function getValorFijo() {
14
- return $this->getConfigData('valorfijo');
15
- }
16
-
17
- public function getValorPorcentaje() {
18
- return $this->getConfigData('valorporcentaje');
19
- }
20
-
21
- public function getValorTope() {
22
- return $this->getConfigData('montotope');
23
- }
24
- public function getValorInferior(){
25
- return $this->getConfigData('valorinferior');
26
- }
27
- public function getValorSuperior(){
28
- return $this->getConfigData('valorsuperior');
29
- }
30
- public function getValorComisionImp(){
31
- return $this->getConfigData('comisionimp');
32
- }
33
- public function getValInfFix(){
34
- return $this->getConfigData('valinffix');
35
- }
36
- public function getValSupFix(){
37
- return $this->getConfigData('valsupfix');
38
- }
39
- public function getCustomText()
40
- {
41
- return $this->getConfigData('customtext');
42
- }
43
}
6
protected $_formBlockType = 'reembolso/form';
7
protected $_infoBlockType = 'reembolso/info';
8
9
+ protected function __contruct(){
10
+ $this->setReembolsoTitle($this->getConfigData('title'));
11
+ $this->setValorTope($this->getConfigData('montotope'));
12
+ $this->setValorInferior($this->getConfigData('valorinferior'));
13
+ $this->setValorSuperior($this->getConfigData('valorsuperior'));
14
+ $this->setValInfFix($this->getConfigData('valinffix'));
15
+ $this->setValSupFix($this->getConfigData('valsupfix'));
16
+ $this->setCustomTextForm($this->getConfigData('customtextform'));
17
+ $this->setCustomTextInfo($this->getConfigData('customtextinfo'));
18
}
19
}
app/code/local/Mage/Reembolso/etc/config.xml CHANGED
@@ -1,74 +1,61 @@
1
<?xml version="1.0"?>
2
<config>
3
- <global>
4
- <models>
5
- <reembolso>
6
- <class>Mage_Reembolso_Model</class>
7
- </reembolso>
8
- <sales>
9
- <rewrite>
10
- <quote>Mage_Reembolso_Model_Quote</quote>
11
- </rewrite>
12
- </sales>
13
- </models>
14
15
- <resources>
16
- <reembolso_setup>
17
- <setup>
18
- <module>Mage_Reembolso</module>
19
- </setup>
20
- <connection>
21
- <use>core_setup</use>
22
- </connection>
23
- </reembolso_setup>
24
- <reembolso_write>
25
- <use>core_write</use>
26
- </reembolso_write>
27
- <reembolso_read>
28
- <use>core_read</use>
29
- </reembolso_read>
30
- </resources>
31
- </global>
32
33
- <adminhtml>
34
- <translate>
35
- <modules>
36
- <Mage_Reembolso>
37
- <files>
38
- <default>Mage_Reembolso.csv</default>
39
- </files>
40
- </Mage_Reembolso>
41
- </modules>
42
- </translate>
43
- </adminhtml>
44
-
45
- <frontend>
46
- <translate>
47
- <modules>
48
- <Mage_Reembolso>
49
- <files>
50
- <default>Mage_Reembolso.csv</default>
51
- </files>
52
- </Mage_Reembolso>
53
- </modules>
54
- </translate>
55
- </frontend>
56
57
- <default>
58
- <payment>
59
- <reembolso>
60
- <active>1</active>
61
- <model>reembolso/reembolso</model>
62
- <order_status>1</order_status>
63
- <title>Reembolso</title>
64
- <allowspecific>0</allowspecific>
65
- <valorinferior>3</valorinferior>
66
- <valinffix>1</valinffix>
67
- <valorsuperior>3</valorsuperior>
68
- <valsupfix>0</valsupfix>
69
- <montotope>100</montotope>
70
- </reembolso>
71
- </payment>
72
- </default>
73
-
74
- </config>
1
<?xml version="1.0"?>
2
<config>
3
+ <global>
4
+ <models>
5
+ <reembolso>
6
+ <class>Mage_Reembolso_Model</class>
7
+ </reembolso>
8
+ <sales>
9
+ <rewrite>
10
+ <quote>Mage_Reembolso_Model_Quote</quote>
11
+ </rewrite>
12
+ </sales>
13
+ </models>
14
15
+ <resources>
16
+ <reembolso_setup>
17
+ <setup>
18
+ <module>Mage_Reembolso</module>
19
+ </setup>
20
+ <connection>
21
+ <use>core_setup</use>
22
+ </connection>
23
+ </reembolso_setup>
24
+ <reembolso_write>
25
+ <use>core_write</use>
26
+ </reembolso_write>
27
+ <reembolso_read>
28
+ <use>core_read</use>
29
+ </reembolso_read>
30
+ </resources>
31
+ </global>
32
33
+ <adminhtml>
34
+ <translate>
35
+ <modules>
36
+ <Mage_Reembolso>
37
+ <files>
38
+ <default>Mage_Reembolso.csv</default>
39
+ </files>
40
+ </Mage_Reembolso>
41
+ </modules>
42
+ </translate>
43
+ </adminhtml>
44
45
+ <default>
46
+ <payment>
47
+ <reembolso>
48
+ <active>1</active>
49
+ <model>reembolso/reembolso</model>
50
+ <order_status>1</order_status>
51
+ <title>Reembolso</title>
52
+ <allowspecific>0</allowspecific>
53
+ <valorinferior>3</valorinferior>
54
+ <valinffix>1</valinffix>
55
+ <valorsuperior>3</valorsuperior>
56
+ <valsupfix>0</valsupfix>
57
+ <montotope>100</montotope>
58
+ </reembolso>
59
+ </payment>
60
+ </default>
61
+ </config>
app/code/local/Mage/Reembolso/etc/system.xml CHANGED
@@ -55,7 +55,7 @@
55
<show_in_store>1</show_in_store>
56
</specificcountry>
57
<montotope translate="label">
58
- <label>Monto Tope</label>
59
<frontend_type>text</frontend_type>
60
<sort_order>60</sort_order>
61
<show_in_default>1</show_in_default>
@@ -63,7 +63,7 @@
63
<show_in_store>0</show_in_store>
64
</montotope>
65
<valorinferior translate="label">
66
- <label>Valor Inferior</label>
67
<frontend_type>text</frontend_type>
68
<sort_order>70</sort_order>
69
<show_in_default>1</show_in_default>
@@ -71,8 +71,8 @@
71
<show_in_store>0</show_in_store>
72
</valorinferior>
73
<valinffix translate="label comment">
74
- <label>V. Inferior Fijo</label>
75
- <comment>No en Fijo sera tomado como Porcentaje</comment>
76
<frontend_type>select</frontend_type>
77
<source_model>adminhtml/system_config_source_yesno</source_model>
78
<sort_order>71</sort_order>
@@ -81,7 +81,7 @@
81
<show_in_store>0</show_in_store>
82
</valinffix>
83
<valorsuperior translate="label">
84
- <label>Valor Superior</label>
85
<frontend_type>text</frontend_type>
86
<sort_order>80</sort_order>
87
<show_in_default>1</show_in_default>
@@ -89,8 +89,8 @@
89
<show_in_store>0</show_in_store>
90
</valorsuperior>
91
<valsupfix translate="label comment">
92
- <label>V. Superior Fijo</label>
93
- <comment>No en Fijo sera tomado como Porcentaje</comment>
94
<frontend_type>select</frontend_type>
95
<source_model>adminhtml/system_config_source_yesno</source_model>
96
<sort_order>81</sort_order>
@@ -98,14 +98,22 @@
98
<show_in_website>1</show_in_website>
99
<show_in_store>0</show_in_store>
100
</valsupfix>
101
- <customtext translate="label">
102
- <label>Custom text for checkout page</label>
103
- <frontend_type>text</frontend_type>
104
- <sort_order>90</sort_order>
105
- <show_in_default>1</show_in_default>
106
- <show_in_website>1</show_in_website>
107
- <show_in_store>0</show_in_store>
108
- </customtext>
109
</fields>
110
</reembolso>
111
</groups>
55
<show_in_store>1</show_in_store>
56
</specificcountry>
57
<montotope translate="label">
58
+ <label>Capture Amount</label>
59
<frontend_type>text</frontend_type>
60
<sort_order>60</sort_order>
61
<show_in_default>1</show_in_default>
63
<show_in_store>0</show_in_store>
64
</montotope>
65
<valorinferior translate="label">
66
+ <label>Lower value</label>
67
<frontend_type>text</frontend_type>
68
<sort_order>70</sort_order>
69
<show_in_default>1</show_in_default>
71
<show_in_store>0</show_in_store>
72
</valorinferior>
73
<valinffix translate="label comment">
74
+ <label>Lower value fix</label>
75
+ <comment>If NO is selected, the lower value is take in percent</comment>
76
<frontend_type>select</frontend_type>
77
<source_model>adminhtml/system_config_source_yesno</source_model>
78
<sort_order>71</sort_order>
81
<show_in_store>0</show_in_store>
82
</valinffix>
83
<valorsuperior translate="label">
84
+ <label>Higher value</label>
85
<frontend_type>text</frontend_type>
86
<sort_order>80</sort_order>
87
<show_in_default>1</show_in_default>
89
<show_in_store>0</show_in_store>
90
</valorsuperior>
91
<valsupfix translate="label comment">
92
+ <label>Higher value fix</label>
93
+ <comment>If NO is selected, the higher value is take in percent</comment>
94
<frontend_type>select</frontend_type>
95
<source_model>adminhtml/system_config_source_yesno</source_model>
96
<sort_order>81</sort_order>
98
<show_in_website>1</show_in_website>
99
<show_in_store>0</show_in_store>
100
</valsupfix>
101
+ <customtextform translate="label">
102
+ <label>Custom text for checkout page in form</label>
103
+ <frontend_type>textarea</frontend_type>
104
+ <sort_order>90</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>0</show_in_store>
108
+ </customtextform>
109
+ <customtextinfo translate="label">
110
+ <label>Custom text for checkout page in column of info</label>
111
+ <frontend_type>textarea</frontend_type>
112
+ <sort_order>90</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>0</show_in_store>
116
+ </customtextinfo>
117
</fields>
118
</reembolso>
119
</groups>
app/design/frontend/default/default/template/reembolso/form.phtml CHANGED
@@ -3,5 +3,10 @@
3
<tr>
4
<td><?php echo $this->__('El pago ser&aacute; realizado en la direcci&oacute;n de destino') ?></td>
5
</tr>
6
</table>
7
</div>
3
<tr>
4
<td><?php echo $this->__('El pago ser&aacute; realizado en la direcci&oacute;n de destino') ?></td>
5
</tr>
6
+ <?php if ($this->getMethod()->getCustomTextForm()): ?>
7
+ <tr>
8
+ <td><?php echo $this->getMethod()->getCustomTextForm() ?></td>
9
+ </tr>
10
+ <?php endif; ?>
11
</table>
12
</div>
app/design/frontend/default/default/template/reembolso/info.phtml CHANGED
@@ -1,5 +1,5 @@
1
<p><?php echo $this->__('Pago contra reembolso' ) ?><br />
2
- <?php if ($this->getMethod()->getCustomText()): ?>
3
- <?php echo $this->getMethod()->getCustomText() ?><br />
4
- <?php endif; ?>
5
</p>
1
<p><?php echo $this->__('Pago contra reembolso' ) ?><br />
2
+ <?php if ($this->getMethod()->getCustomTextInfo()): ?>
3
+ <?php echo $this->getMethod()->getCustomTextInfo() ?><br />
4
+ <?php endif; ?>
5
</p>
app/locale/es_ES/Mage_Reembolso.csv ADDED
@@ -0,0 +1,8 @@
1
+ Lower value,Valor inferior
2
+ Lower value fix,Valor inferior fijo
3
+ Higher value,Valor superior
4
+ Higher value fix,Valor superior fijo
5
+ "If NO is selected, the lower value is take in percent","Si esta seleccionado NO, el valor inferior sera tomado como porcentaje"
6
+ "If NO is selected, the higher value is take in percent","Si esta seleccionado NO, el valor superior sera tomado como porcentaje"
7
+ Custom text for checkout page in form,Texto personalizado para el formulario de la pagina de checkout
8
+ Custom text for checkout page in column of info,Texto personalizado para la informacion de la pagina de checkout
package.xml CHANGED
@@ -1,7 +1,7 @@
1
<?xml version="1.0"?>
2
<package>
3
<name>Payment_Reembolso</name>
4
- <version>0.1.3</version>
5
<stability>stable</stability>
6
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
<channel>community</channel>
@@ -10,16 +10,20 @@
10
<description>It establishes different amount for the amount of the purchase. If it is minor that the Certain amount, the amount of the service will be a fixed value; if the amount is major that the Certain amount, the amount of the service will be a percentage of the same one.
11
To do:
12
Set from the control panel the fixed value, the value percentage and the Certain amount.</description>
13
- <notes>* Adds the custom text message in the control panel.
14
15
- CHANGES:
16
- -&gt;U app/code/local/Mage/Reembolso/Model/Reembolso.php
17
- -&gt;U app/code/local/Mage/Reembolso/etc/system.xml
18
- -&gt;U app/design/frontend/default/default/template/reembolso/info.phtml</notes>
19
- <authors><author><name>Sophie</name><user>auto-converted</user><email>lalyostres@gmail.com</email></author></authors>
20
- <date>2008-12-01</date>
21
- <time>11:36:53</time>
22
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="reembolso"><file name="form.phtml" hash="ce75a81d61ec34a17aafc9f8c3b22dcc"/><file name="info.phtml" hash="57dfa8759788a77326a833603cb978e6"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="reembolso"><file name="form.phtml" hash="ce75a81d61ec34a17aafc9f8c3b22dcc"/><file name="info.phtml" hash="95c8db91eb3230388d2a807d3117fbbe"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Mage"><dir name="Reembolso"><dir name="Block"><file name="Form.php" hash="21f1e325029d98571ec884bca2234e65"/><file name="Info.php" hash="33f48eab752f05362c553b63de5d9c42"/></dir><dir name="etc"><file name="config.xml" hash="73c38c018475f948b5a1813ba9f90de7"/><file name="system.xml" hash="5b97356ec1b91229cceda5960cf121db"/></dir><dir name="Model"><file name="Quote.php" hash="184e58bdc10e73a0ade664e55d43b7ec"/><file name="Reembolso.php" hash="b3a1eb16a323a49431f43f00fb5f437b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Reembolso.xml" hash="a5a370ae7cb7f2b0f72b15e7d500f47d"/></dir></target></contents>
23
<compatible/>
24
<dependencies/>
25
</package>
1
<?xml version="1.0"?>
2
<package>
3
<name>Payment_Reembolso</name>
4
+ <version>0.1.4</version>
5
<stability>stable</stability>
6
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
<channel>community</channel>
10
<description>It establishes different amount for the amount of the purchase. If it is minor that the Certain amount, the amount of the service will be a fixed value; if the amount is major that the Certain amount, the amount of the service will be a percentage of the same one.
11
To do:
12
Set from the control panel the fixed value, the value percentage and the Certain amount.</description>
13
+ <notes>* Add translate file
14
+ * Adds different custom message
15
16
+ &lt;b&gt;CHANGES:&lt;/b&gt;
17
+ -&gt;A app/locale/es_ES/Mage_Reembolso.csv
18
+ -&gt;U app/code/local/Mage/Reembolso/etc/system.xml
19
+ -&gt;U app/code/local/Mage/Reembolso/Model/Reembolso.php
20
+ -&gt;U app/code/local/Mage/Reembolso/etc/config.xml
21
+ -&gt;U app/design/frontend/default/default/template/reembolso/form.phtml
22
+ -&gt;U app/design/frontend/default/default/template/reembolso/info.phtml</notes>
23
+ <authors><author><name>Sophie</name><user>auto-converted</user><email>lalyostres@gmail.com</email></author><author><name>Manuel</name><user>auto-converted</user><email>manuelcanepa@gmail.com</email></author></authors>
24
+ <date>2008-12-03</date>
25
+ <time>14:57:46</time>
26
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="reembolso"><file name="form.phtml" hash="ce75a81d61ec34a17aafc9f8c3b22dcc"/><file name="info.phtml" hash="57dfa8759788a77326a833603cb978e6"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="reembolso"><file name="form.phtml" hash="5f5fbdb3061101cbb748a01268a6c29a"/><file name="info.phtml" hash="19d5379474940351367f3459822c1810"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="es_ES"><file name="Mage_Reembolso.csv" hash="42e01f656ee2d0223e95e10ed54b26ce"/></dir></target><target name="magelocal"><dir name="Mage"><dir name="Reembolso"><dir name="Block"><file name="Form.php" hash="21f1e325029d98571ec884bca2234e65"/><file name="Info.php" hash="33f48eab752f05362c553b63de5d9c42"/></dir><dir name="etc"><file name="config.xml" hash="7c46dc9ef3f9811fe3cf40de917a6656"/><file name="system.xml" hash="8e1bf64b00d65ed46452f359e9b8ae01"/></dir><dir name="Helper"><file name="Data.php" hash="1445d2b92929e66446fe0c1ae4620d55"/></dir><dir name="Model"><file name="Quote.php" hash="6059126218ee9aa9f3a6c18e41ef6255"/><file name="Reembolso.php" hash="783d6cd48a4350c7cb196b2f834dab7a"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Reembolso.xml" hash="a5a370ae7cb7f2b0f72b15e7d500f47d"/></dir></target></contents>
27
<compatible/>
28
<dependencies/>
29
</package>