minimum_order_fee - Version 0.1.7

Version Notes

error in paypal

Download this release

Release Info

Developer Commerce Bees
Extension minimum_order_fee
Version 0.1.7
Comparing to
See all releases


Code changes from version 0.1.6 to 0.1.7

app/code/community/Ameex/MinimumorderFee/Model/Observer.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ameex_MinimumorderFee_Model_Observer
3
+ {
4
+ public function addScreenToPayPal(Varien_Event_Observer $observer)
5
+ {
6
+ $paypal_cart = $observer->getPaypalCart();
7
+ $amount = $paypal_cart->getSalesEntity()->getCustomFeeAmount();
8
+ if ($amount) {
9
+ $paypal_cart->addItem(Mage::helper('minimumorderfee')->__('Minimum order fee'), 1, $amount, 'Minimum order fee');
10
+ }
11
+ }
12
+ }
app/code/community/Ameex/MinimumorderFee/Model/Sales/Quote/Address/Total/Minimumorderfee.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  class Ameex_MinimumorderFee_Model_Sales_Quote_Address_Total_Minimumorderfee extends Mage_Sales_Model_Quote_Address_Total_Abstract{
3
- protected $minimumfeeTiers=array(0=>10,5=>20,10=>30,);
4
  public function __construct(){
5
  $this->setCode('minimumorderfee');
6
  }
@@ -38,18 +38,26 @@ class Ameex_MinimumorderFee_Model_Sales_Quote_Address_Total_Minimumorderfee exte
38
  case 1 :
39
  $address->setBaseCustomFeeAmount($minimumorderfee);
40
  $address->setCustomFeeAmount($minimumorderfee);
41
- $this->_addBaseAmount($minimumorderfee);
42
- $this->_addAmount($minimumorderfee);
43
- return $this;
 
 
 
 
44
  break;
45
  case 2 :
46
  /* case 2 is for percentage of fixed amount */
47
  $percentcalculation=$subtotal*($minimumorderfee/100);
48
  $address->setBaseCustomFeeAmount($percentcalculation);
49
  $address->setCustomFeeAmount($percentcalculation);
50
- $this->_addBaseAmount($percentcalculation);
51
- $this->_addAmount($percentcalculation);
52
- return $this;
 
 
 
 
53
 
54
  }
55
  }
1
  <?php
2
  class Ameex_MinimumorderFee_Model_Sales_Quote_Address_Total_Minimumorderfee extends Mage_Sales_Model_Quote_Address_Total_Abstract{
3
+ //protected $minimumfeeTiers=array(0=>10,5=>20,10=>30,);
4
  public function __construct(){
5
  $this->setCode('minimumorderfee');
6
  }
38
  case 1 :
39
  $address->setBaseCustomFeeAmount($minimumorderfee);
40
  $address->setCustomFeeAmount($minimumorderfee);
41
+ //$this->_addBaseAmount($minimumorderfee);
42
+ //$this->_addAmount($minimumorderfee);
43
+ //return $this;
44
+ $quote->setCustomFeeAmount($minimumorderfee);
45
+
46
+ $address->setGrandTotal($address->getGrandTotal() + $address->getCustomFeeAmount());
47
+ $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseCustomFeeAmount());
48
  break;
49
  case 2 :
50
  /* case 2 is for percentage of fixed amount */
51
  $percentcalculation=$subtotal*($minimumorderfee/100);
52
  $address->setBaseCustomFeeAmount($percentcalculation);
53
  $address->setCustomFeeAmount($percentcalculation);
54
+ //$this->_addBaseAmount($percentcalculation);
55
+ //$this->_addAmount($percentcalculation);
56
+ //return $this;
57
+ $quote->setCustomFeeAmount($percentcalculation);
58
+
59
+ $address->setGrandTotal($address->getGrandTotal() + $address->getCustomFeeAmount());
60
+ $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseCustomFeeAmount());
61
 
62
  }
63
  }
app/code/community/Ameex/MinimumorderFee/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Ameex_MinimumorderFee>
5
- <version>0.1.6</version>
6
  </Ameex_MinimumorderFee>
7
  </modules>
8
  <frontend>
@@ -100,6 +100,17 @@
100
  <class>Ameex_MinimumorderFee_Helper</class>
101
  </minimumorderfee>
102
  </helpers>
 
 
 
 
 
 
 
 
 
 
 
103
  </global>
104
  <adminhtml>
105
  <layout>
2
  <config>
3
  <modules>
4
  <Ameex_MinimumorderFee>
5
+ <version>0.1.7</version>
6
  </Ameex_MinimumorderFee>
7
  </modules>
8
  <frontend>
100
  <class>Ameex_MinimumorderFee_Helper</class>
101
  </minimumorderfee>
102
  </helpers>
103
+ <events>
104
+ <paypal_prepare_line_items>
105
+ <observers>
106
+ <minimumorderfee>
107
+ <type>singleton</type>
108
+ <class>minimumorderfee/observer</class>
109
+ <method>addScreenToPayPal</method>
110
+ </minimumorderfee>
111
+ </observers>
112
+ </paypal_prepare_line_items>
113
+ </events>
114
  </global>
115
  <adminhtml>
116
  <layout>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>minimum_order_fee</name>
4
- <version>0.1.6</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>MinimumorderFee Module is used to apply fee for the minimum order.</summary>
10
  <description>This module is used to add some fee for the minimum order. It checks the subtotal, if the subtotal is less than minimum order amount, it adds some fee to the grand total.</description>
11
- <notes>Added a new option to select minimum order fee calculation</notes>
12
  <authors><author><name>commercebees</name><user>CommerceBees</user><email>commercebees@ameexusa.com</email></author></authors>
13
- <date>2016-01-07</date>
14
- <time>09:20:14</time>
15
- <contents><target name="magecommunity"><dir><dir name="Ameex"><dir name="MinimumorderFee"><dir><dir name="Block"><dir name="Checkout"><dir name="Total"><file name="Minimumorderfee.php" hash="2ac6dba02061a92ddbbb7f6c52f40efd"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="Totals"><file name="Minimumorderfee.php" hash="453e083a54c94ef309326685b3dfde9b"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="b77a1ffaa1a6e8644f5a6d8e61215d97"/></dir><dir name="Model"><file name="Calculation.php" hash="9614043c12b871ca481b655852273c9c"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><dir name="Total"><file name="Minimumorderfee.php" hash="e865b993fdcdeb5fa07fb76a7d0be5ce"/></dir></dir><dir name="Invoice"><dir name="Total"><file name="Minimumorderfee.php" hash="3ef96c49bc61697f1f8fb844e113b7b0"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Minimumorderfee.php" hash="29fc31f031a0a03a9c60043bc4cb0957"/></dir></dir><file name="Address.php" hash="5b6d17fd695c869e921a15aaa3a7df1a"/></dir></dir><file name="Value.php" hash="ad6d8ab9e8779f47b13c227c3c027031"/></dir><dir name="controllers"><file name="CartController.php" hash="d04f3175a847d7ec4aa3eb4d31a66109"/></dir><dir name="etc"><file name="config.xml" hash="debf01feabe5b26e255e196c37d11b67"/><file name="system.xml" hash="7f2338005c278d534ba9fd26df257a9c"/></dir><dir name="sql"><dir name="ameex_minimumorderfee_setup"><file name="Upgrade-0.1.0-0.1.1.php" hash="dcebf42adc69443d3db85f9664bb5449"/><file name="install-0.1.0.php" hash="6255d9eb79ccae8f5ffe6d6202d1df4c"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Ameex_MinimumorderFee.xml" hash="2e7539c1ae8b3c207ce3f79a47df9428"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="minimumorderfee.xml" hash="a925b6be53c38c50549d2f496c49a4f8"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="minimumorderfee.xml" hash="203d1cb98bc986252c0b2d52cc0312eb"/></dir><dir name="template"><dir name="checkout"><dir name="total"><file name="minimumorderfee.phtml" hash="136d9fa337c7b2b4c0218adaf6930241"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="."><file name="CommerceBees_Minimumorder_Fee_Extension_Guide_V0.1.1 .pdf" hash="103ff1b355410d85712c7300c2150f7f"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>minimum_order_fee</name>
4
+ <version>0.1.7</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>MinimumorderFee Module is used to apply fee for the minimum order.</summary>
10
  <description>This module is used to add some fee for the minimum order. It checks the subtotal, if the subtotal is less than minimum order amount, it adds some fee to the grand total.</description>
11
+ <notes>error in paypal</notes>
12
  <authors><author><name>commercebees</name><user>CommerceBees</user><email>commercebees@ameexusa.com</email></author></authors>
13
+ <date>2016-01-08</date>
14
+ <time>13:37:35</time>
15
+ <contents><target name="magecommunity"><dir><dir name="Ameex"><dir name="MinimumorderFee"><dir name="Block"><dir name="Checkout"><dir name="Total"><file name="Minimumorderfee.php" hash="2ac6dba02061a92ddbbb7f6c52f40efd"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="Totals"><file name="Minimumorderfee.php" hash="453e083a54c94ef309326685b3dfde9b"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="b77a1ffaa1a6e8644f5a6d8e61215d97"/></dir><dir name="Model"><file name="Calculation.php" hash="9614043c12b871ca481b655852273c9c"/><file name="Observer.php" hash="f5be70b413e29e54d11d1b85ade54d86"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><dir name="Total"><file name="Minimumorderfee.php" hash="e865b993fdcdeb5fa07fb76a7d0be5ce"/></dir></dir><dir name="Invoice"><dir name="Total"><file name="Minimumorderfee.php" hash="3ef96c49bc61697f1f8fb844e113b7b0"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Minimumorderfee.php" hash="feb564362bc04d214ced018d41c4f6f1"/></dir></dir><file name="Address.php" hash="5b6d17fd695c869e921a15aaa3a7df1a"/></dir></dir><file name="Value.php" hash="ad6d8ab9e8779f47b13c227c3c027031"/></dir><dir name="controllers"><file name="CartController.php" hash="d04f3175a847d7ec4aa3eb4d31a66109"/></dir><dir name="etc"><file name="config.xml" hash="cc8188667b7fb7222e8704d5505856a3"/><file name="system.xml" hash="7f2338005c278d534ba9fd26df257a9c"/></dir><dir name="sql"><dir name="ameex_minimumorderfee_setup"><file name="Upgrade-0.1.0-0.1.1.php" hash="dcebf42adc69443d3db85f9664bb5449"/><file name="install-0.1.0.php" hash="6255d9eb79ccae8f5ffe6d6202d1df4c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Ameex_MinimumorderFee.xml" hash="2e7539c1ae8b3c207ce3f79a47df9428"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="minimumorderfee.xml" hash="a925b6be53c38c50549d2f496c49a4f8"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="minimumorderfee.xml" hash="203d1cb98bc986252c0b2d52cc0312eb"/></dir><dir name="template"><dir name="checkout"><dir name="total"><file name="minimumorderfee.phtml" hash="136d9fa337c7b2b4c0218adaf6930241"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="."><file name="CommerceBees_Minimumorder_Fee_Extension_Guide_V0.1.1 .pdf" hash="103ff1b355410d85712c7300c2150f7f"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>