Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 3
Surcharge if order < minimum_order
 
Georg Ringer
Member
 
Avatar
Total Posts:  63
Joined:  2008-07-04
Linz, Austria
 

Hi,

I know how to configure a minimum_order but what I need is a bit more: If the amount is below the e.g. 25€, there should be a surcharge of 5€.

I also know about the fixed costs but they dont help me there.

Negative discount would be just perfect but is not possible yet, another thread about this is here: http://www.magentocommerce.com/boards/viewthread/17293/

What do you think? Is there any solution for me?
Thanks a lot
Georg

 
Magento Community Magento Community
Magento Community
Magento Community
 
Georg Ringer
Member
 
Avatar
Total Posts:  63
Joined:  2008-07-04
Linz, Austria
 

I fixed it myself with the following changes in the core files:

/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php, #130:
Delete or comment out the following lines which check at the server-side for values < 0

if ($this->getRequest()->getParam('discount_amount') < 0{
                    Mage
::throwException(Mage::helper('salesrule')->__('Invalid discount amount.'));
                
}

/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Actions.php, #63 +
/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php, #61
Delete or comment out the following line which checks at the client-side for values < 0

'class' => 'validate-not-negative-number',

Of course you can check in your template files if the discount is > 0 and change the name from Discount to Surcharge or whatever.

Georg

 
Magento Community Magento Community
Magento Community
Magento Community
 
Discovery
Enthusiast
 
Total Posts:  767
Joined:  2007-12-29
 

Genius

 
Magento Community Magento Community
Magento Community
Magento Community
 
Georg Ringer
Member
 
Avatar
Total Posts:  63
Joined:  2008-07-04
Linz, Austria
 

thx wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
Discovery
Enthusiast
 
Total Posts:  767
Joined:  2007-12-29
 

@Georg - thanks so much for the tip. However, I needed a rule that applied on a product not at checkout. This is because of an intricacy of how I wish to waive setup fees when ordering multiples, on a ‘cart’ rule it was showing up a little heavy, on the product it appears good in the cart - if you get my drift…

Anyway, to do this I had to edit the Catalog Controller page to remove the discount validator:

vi ./app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php

 
Magento Community Magento Community
Magento Community
Magento Community
 
till
Member
 
Total Posts:  58
Joined:  2007-12-17
 

Did anyone request this as a feature yet? I don’t want to edit files in my store and loose it next time I update my system.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Georg Ringer
Member
 
Avatar
Total Posts:  63
Joined:  2008-07-04
Linz, Austria
 

I didn’t, so please go on!

 
Magento Community Magento Community
Magento Community
Magento Community
 
till
Member
 
Total Posts:  58
Joined:  2007-12-17
 

Requested:
http://www.magentocommerce.com/boards/viewthread/21188/

 
Magento Community Magento Community
Magento Community
Magento Community
 
husby
Member
 
Avatar
Total Posts:  72
Joined:  2009-01-07
Roseville, MN
 

The code is no longer in /app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php, #130:

They have moved it to app/code/core/Mage/Rule/Model/Rule.php, #231

as of version 1.1.7 (as I noticed in the upgrade diff file).  The other files mentioned are still the same
/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Actions.php, #63 +
/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php, #61

Hope this helps someone.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nautica
Sr. Member
 
Avatar
Total Posts:  140
Joined:  2008-01-03
 
Georg Ringer - 08 October 2008 05:50 AM

Of course you can check in your template files if the discount is > 0 and change the name from Discount to Surcharge or whatever.

Georg

Your Solution works perfect and i made two cart actions for adding extra costs for creditcard payment and adding low order fee.
Only i cannot find where the text in the template i generated so i can change the text to Surcharge.
Can someone pinpoint me where these files are located?

 
Magento Community Magento Community
Magento Community
Magento Community
 
caterox
Jr. Member
 
Total Posts:  11
Joined:  2009-01-08
 

not working for me…

I modified the files You suggested, and the admin interface has it good, but it doesn’t charge on checkout, only discount…
If anyone knows what can be the problem, let me know please…

thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nautica
Sr. Member
 
Avatar
Total Posts:  140
Joined:  2008-01-03
 

Anyone got this hack running with changed templates that show Surcharge instead of discount?

Please tell me how you did it?
I just try to locate the files where the discount is presented. Guess a lot of files need changes. Not only the checkout pages but also the invoice, order, creditnote etc.
The hack itself works i noticed but its stupid that a customer see the word “discount” what in fact is a surcharge grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
jonny98002
Jr. Member
 
Total Posts:  27
Joined:  2009-02-16
 
husby - 18 February 2009 10:36 AM

The code is no longer in /app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php, #130:

They have moved it to app/code/core/Mage/Rule/Model/Rule.php, #231

.

It is now on Line 242 smile

Where can I edit my template to change the “Discount” to “Surcharge” in the shopping cart?  I can’t seem to find it

 
Magento Community Magento Community
Magento Community
Magento Community
 
johnvan
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2009-02-04
 

I can get the surcharge to work on a product basis. I just want to add the surcharge once not for each product. When I switch to “Fixed amount discount for whole cart” the negative discount stops working. I have commented out the three files mentioned above. Any suggestions on how to get it to work?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jaggsr
Member
 
Total Posts:  39
Joined:  2009-03-25
Ahmedabad, India
 

I have successfully applied the (-ve) discounts to the cart total.

But that is limited to the total price of the product only.

I want to apply it on the total Order price (Total price of Products + shipping charge + Tax)

Any help on that.. ?

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jaggsr
Member
 
Total Posts:  39
Joined:  2009-03-25
Ahmedabad, India
 

You can edit the labels here..
app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php
app/design/adminhtml/default/default/template/sales/order/totals.phtml

Jonny98002 - 23 April 2009 03:06 PM

husby - 18 February 2009 10:36 AM
The code is no longer in /app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php, #130:

They have moved it to app/code/core/Mage/Rule/Model/Rule.php, #231

.

It is now on Line 242 smile

Where can I edit my template to change the “Discount” to “Surcharge” in the shopping cart?  I can’t seem to find it

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 3