How to include tax in minimum order amount magento -
On a French ecommerce, we always display prices including taxes.
I have enabled the minimum order amount.
I have tested it, it works but the system is based on sub-taxes except for taxes, I need a system based on the global amount (including taxes) for this matter. Is it possible? ?
Of course I tried to work with the minimum amount except taxes, but I manage two tax rates. So it can not be good.
Thank you for your help.
It is possible:
-
file / code / App / code / core / pimple / sale / model / quote PHP to
app / code / local / pamphlet / cells / model / quote. Fap: / code>
Open the copied file and Valid Search Minimum Support () Function:
Valid Minimum Amount for the public function ($ Multishipping = false) {$ storeId = $ this- & gt; GetStoreId (); $ MinOrderActive = Dana :: getStoreConfigFlag ('Sales / Minimum Order / Active', $ storeId); $ MinOrderMulti = Dana :: getStoreConfigFlag ('Sales / Minimum_order / Multi-Edder', $ storeId); $ MinAmount = Dana :: getStoreConfig ('Sales / Minimum Order / Amount', $ storeId); If (! $ MinOrderActive) {return true; } $ Address = $ this- & gt; MilenaAdders (); {$ Multishping} {if ($ minOrderMulti) {foreach ($ address $ as address) {foreach ($ address-> getQuote () -> getItemsCollection () $ items) {$ amount} = $ Item- & gt; GetBaseRowTotal () - $ item- & gt; GetBaseDiscountAmount (); If ($ amount & lt; $ minAmount) {return false; }}}} And {$ baseTotal = 0; Foreign Currency ($ Address $ as Address) {/ * @ $ $ Address Mage_Sales_Model_Quote_Address * / $ baseTotal + = $ address- & gt; Matchboxesbottlewidth discount (); } If ($ base katal & lt; $ minAmount) {return false; }}} {Foreach ($ Address $ as Address) {/ * @var $ address Mage_Sales_Model_Quote_Address * / if (! $ Address- & gt; ValidmanAnmount ()) {return false; }}} Be true;
) {$ StoreId = $ this- & gt; GetStoreId (); $ MinOrderActive = Dana :: getStoreConfigFlag ('Sales / Minimum Order / Active', $ storeId); $ MinOrderMulti = Dana :: getStoreConfigFlag ('Sales / Minimum_order / Multi-Edder', $ storeId); $ MinAmount = Dana :: getStoreConfig ('Sales / Minimum Order / Amount', $ storeId); If (! $ MinOrderActive) {return true; } $ Address = $ this- & gt; MilenaAdders (); If ($ multishping) {if ($ minOrderMulti) {foreach ($ address $ as address) {$ grandototal = $ address-> GetQuote () - & gt; Collected Totals () - & gt; Gregtantol (); If ($ granadottle & lt; $ minAmount) {return false; }}} {{Grand Croil = 0; Foreign Currency ($ address as address $ address) {/ * @ $ $ Address Mage_Sales_Model_Quote_Address * / $ Grand Quotel = $ address- & gt; Receive () - & gt; Aggregates () - & gt; Gridendrate (); } If ($ granadottle & lt; $ minAmount) {return false; }}} {Foreach ($ address $ as address) {/ * @var $ address Mage_Sales_Model_Quote_Address * / $ grandTotal = $ address- & gt; Receive () - & gt; Aggregates () - & gt; Gridendrate (); If ($ granadottle & lt; $ minAmount) {return false; }}} Be true; }
Clear Magento cache (
system-> Configuration-> Cash Management
).
We use many collection totals () calls in the new task, to ensure that the grand total has been calculated previously, but the overhead calculations Do not worry about the calculation of double yoga in the collectototals () function:
if ($ this-> getTotalsCollectedFlag ()) {This $ return; }
Comments
Post a Comment