Version Notes
Fixed proceed to checkout issue.
Added a text field in admin to show the message near minimum order fee in cart page
Download this release
Release Info
Developer | Commerce Bees |
Extension | minimum_order_fee |
Version | 0.1.2 |
Comparing to | |
See all releases |
Code changes from version 0.1.1 to 0.1.2
- app/code/community/Ameex/MinimumorderFee/Model/Sales/Quote/Address.php +14 -0
- app/code/community/Ameex/MinimumorderFee/controllers/CartController.php +50 -0
- app/code/community/Ameex/MinimumorderFee/etc/config.xml +15 -1
- app/code/community/Ameex/MinimumorderFee/etc/system.xml +8 -0
- app/design/frontend/base/default/template/checkout/total/minimumorderfee.phtml +1 -1
- package.xml +7 -6
app/code/community/Ameex/MinimumorderFee/Model/Sales/Quote/Address.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_MinimumorderFee_Model_Sales_Quote_Address extends Mage_Sales_Model_Quote_Address
|
3 |
+
{
|
4 |
+
public function validateMinimumAmount()
|
5 |
+
{
|
6 |
+
$amount = Mage::getStoreConfig('sales/minimum_order/amount', $storeId);
|
7 |
+
$minimumorderfee=Mage::getStoreConfig('sales/minimum_order/minimumfee');
|
8 |
+
if (($this->getBaseSubtotalWithDiscount() < $amount) && ($minimumorderfee=='')) {
|
9 |
+
return false;
|
10 |
+
}
|
11 |
+
return true;
|
12 |
+
}
|
13 |
+
|
14 |
+
}
|
app/code/community/Ameex/MinimumorderFee/controllers/CartController.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once(Mage::getModuleDir('controllers','Mage_Checkout').DS.'CartController.php');
|
3 |
+
|
4 |
+
class Ameex_MinimumOrderFee_CartController extends Mage_Checkout_CartController
|
5 |
+
{
|
6 |
+
public function indexAction()
|
7 |
+
{
|
8 |
+
$cart = $this->_getCart();
|
9 |
+
if ($cart->getQuote()->getItemsCount()) {
|
10 |
+
$cart->init();
|
11 |
+
$cart->save();
|
12 |
+
|
13 |
+
if (!$this->_getQuote()->validateMinimumAmount()) {
|
14 |
+
$error_message = Mage::getStoreConfig("sales/minimum_order/error_message");
|
15 |
+
$minimumorderamount=Mage::getStoreConfig('sales/minimum_order/amount');
|
16 |
+
|
17 |
+
$warning = Mage::helper('checkout')->__("$error_message %s", $minimumorderamount);
|
18 |
+
|
19 |
+
$cart->getCheckoutSession()->addNotice($warning);
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
// Compose array of messages to add
|
24 |
+
$messages = array();
|
25 |
+
foreach ($cart->getQuote()->getMessages() as $message) {
|
26 |
+
if ($message) {
|
27 |
+
// Escape HTML entities in quote message to prevent XSS
|
28 |
+
$message->setCode(Mage::helper('core')->escapeHtml($message->getCode()));
|
29 |
+
$messages[] = $message;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
$cart->getCheckoutSession()->addUniqueMessages($messages);
|
33 |
+
|
34 |
+
/**
|
35 |
+
* if customer enteres shopping cart we should mark quote
|
36 |
+
* as modified bc he can has checkout page in another window.
|
37 |
+
*/
|
38 |
+
$this->_getSession()->setCartWasUpdated(true);
|
39 |
+
|
40 |
+
Varien_Profiler::start(__METHOD__ . 'cart_display');
|
41 |
+
$this
|
42 |
+
->loadLayout()
|
43 |
+
->_initLayoutMessages('checkout/session')
|
44 |
+
->_initLayoutMessages('catalog/session')
|
45 |
+
->getLayout()->getBlock('head')->setTitle($this->__('Shopping Cart'));
|
46 |
+
$this->renderLayout();
|
47 |
+
Varien_Profiler::stop(__METHOD__ . 'cart_display');
|
48 |
+
}
|
49 |
+
|
50 |
+
}
|
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 |
</Ameex_MinimumorderFee>
|
7 |
</modules>
|
8 |
<frontend>
|
@@ -13,6 +13,15 @@
|
|
13 |
</minimumorderfee>
|
14 |
</updates>
|
15 |
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
</frontend>
|
17 |
<global>
|
18 |
<blocks>
|
@@ -21,6 +30,11 @@
|
|
21 |
</minimumorderfee>
|
22 |
</blocks>
|
23 |
<models>
|
|
|
|
|
|
|
|
|
|
|
24 |
<minimumorderfee>
|
25 |
<class>Ameex_MinimumorderFee_Model</class>
|
26 |
<resourceModel>ameex_minimumorderfee_resource</resourceModel>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Ameex_MinimumorderFee>
|
5 |
+
<version>0.1.2</version>
|
6 |
</Ameex_MinimumorderFee>
|
7 |
</modules>
|
8 |
<frontend>
|
13 |
</minimumorderfee>
|
14 |
</updates>
|
15 |
</layout>
|
16 |
+
<routers>
|
17 |
+
<checkout>
|
18 |
+
<args>
|
19 |
+
<modules>
|
20 |
+
<ameex_minimumorderfee before="Mage_Checkout">Ameex_MinimumorderFee</ameex_minimumorderfee>
|
21 |
+
</modules>
|
22 |
+
</args>
|
23 |
+
</checkout>
|
24 |
+
</routers>
|
25 |
</frontend>
|
26 |
<global>
|
27 |
<blocks>
|
30 |
</minimumorderfee>
|
31 |
</blocks>
|
32 |
<models>
|
33 |
+
<sales>
|
34 |
+
<rewrite>
|
35 |
+
<quote_address>Ameex_MinimumorderFee_Model_Sales_Quote_Address</quote_address>
|
36 |
+
</rewrite>
|
37 |
+
</sales>
|
38 |
<minimumorderfee>
|
39 |
<class>Ameex_MinimumorderFee_Model</class>
|
40 |
<resourceModel>ameex_minimumorderfee_resource</resourceModel>
|
app/code/community/Ameex/MinimumorderFee/etc/system.xml
CHANGED
@@ -22,6 +22,14 @@
|
|
22 |
<show_in_website>1</show_in_website>
|
23 |
<show_in_stores>1</show_in_stores>
|
24 |
</feecalculation>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
</fields>
|
26 |
</minimum_order>
|
27 |
</groups>
|
22 |
<show_in_website>1</show_in_website>
|
23 |
<show_in_stores>1</show_in_stores>
|
24 |
</feecalculation>
|
25 |
+
<details translate="label">
|
26 |
+
<label>Text to display in checkout page</label>
|
27 |
+
<frontend_type>textarea</frontend_type>
|
28 |
+
<sort_order>10</sort_order>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_stores>1</show_in_stores>
|
32 |
+
</details>
|
33 |
</fields>
|
34 |
</minimum_order>
|
35 |
</groups>
|
app/design/frontend/base/default/template/checkout/total/minimumorderfee.phtml
CHANGED
@@ -32,7 +32,7 @@
|
|
32 |
<?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?>
|
33 |
<br/><a class="" onclick="expandDetails(this, '.noticetexts'); return false;" href="#">Details</a>
|
34 |
<?php $minimumamount= Mage::getStoreConfig('sales/minimum_order/amount'); ?>
|
35 |
-
<p class="noticetexts" style="display: none;">
|
36 |
</td>
|
37 |
<td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right">
|
38 |
<?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?>
|
32 |
<?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?>
|
33 |
<br/><a class="" onclick="expandDetails(this, '.noticetexts'); return false;" href="#">Details</a>
|
34 |
<?php $minimumamount= Mage::getStoreConfig('sales/minimum_order/amount'); ?>
|
35 |
+
<p class="noticetexts" style="display: none;"> <?php echo Mage::getStoreConfig("sales/minimum_order/details").Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol().$minimumamount; ?> </p>
|
36 |
</td>
|
37 |
<td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right">
|
38 |
<?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?>
|
package.xml
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>minimum_order_fee</name>
|
4 |
-
<version>0.1.
|
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>
|
12 |
-
|
13 |
-
<
|
14 |
-
<
|
15 |
-
<
|
|
|
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.2</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>Fixed proceed to checkout issue.
|
12 |
+
Added a text field in admin to show the message near minimum order fee in cart page</notes>
|
13 |
+
<authors><author><name>commercebees</name><user>CommerceBees</user><email>commercebees@ameexusa.com</email></author></authors>
|
14 |
+
<date>2015-10-23</date>
|
15 |
+
<time>17:12:30</time>
|
16 |
+
<contents><target name="mageetc"><dir><dir name="modules"><file name="Ameex_MinimumorderFee.xml" hash="2e7539c1ae8b3c207ce3f79a47df9428"/></dir></dir></target><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"><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="ec874a449b527a4400aacb41a2ff7708"/></dir></dir><file name="Address.php" hash="4f64da54f72fd099fcf5fcedadbe7b84"/></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="133733c3bcc039580ee620f6d8fb9487"/><file name="system.xml" hash="4aa6add49055b684871f2b5ee993ba6e"/></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="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="d4499b8bfd461242d9566445ab09693c"/></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>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|