Magento Forum

Page 2 of 2
A simple means of disabling the discount / coupon code ………
 
beyoyo2
Jr. Member
 
Total Posts:  17
Joined:  2010-06-02
 

if you comment out the block \"checkout/cart_shipping\" that removes your ability to collect tax based on anything.

Seems like a problem.

If you create an \"extension\" what happens when they do an update? won\’t that get removed?

 
Magento Community Magento Community
Magento Community
Magento Community
 
frano9
Jr. Member
 
Avatar
Total Posts:  20
Joined:  2010-01-21
Manchester
 

It won’t be removed. Could be outdated (I doubt it) but not removed.

About the system.xml it’s in your module’s etc folder.

F.E : app/code/local/NAMESPACE/MODULE/etc/system.xml

 
Magento Community Magento Community
Magento Community
Magento Community
 
kasssim
Jr. Member
 
Total Posts:  14
Joined:  2008-09-17
 
lenlucas - 12 December 2008 06:48 AM

A slightly better way to do this would be to comment out the following code in /app/design/frontend/yourtheme/default/layout/checkout.xml

<!--            <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/> -->
<!--            <
block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/> -->

You can edit XML layout files in this way to remove sections you don’t want.

thanks alot it helped and worked!

 
Magento Community Magento Community
Magento Community
Magento Community
 
beyoyo2
Jr. Member
 
Total Posts:  17
Joined:  2010-06-02
 

I can’t get the module to appear in the Admin.
Using Magento I.6
Cleared Caches… nothing.

Doesn’t the module need to be “activated”?

 
Magento Community Magento Community
Magento Community
Magento Community
 
beyoyo2
Jr. Member
 
Total Posts:  17
Joined:  2010-06-02
 

Ok.. well this morning voila… i the backend is now showing up.
But the cart page… well.. its blank.
This line seems to be the problem… but it obviously won’t work without it…

<?php $show = (int)Mage::getStoreConfig('sales/discounts/show_frontend');
if(!
$show) return; ?>

What’s missing?

 
Magento Community Magento Community
Magento Community
Magento Community
 
robbmaclean
Jr. Member
 
Total Posts:  7
Joined:  2010-05-05
 

This answer is a little late, but just in case anyone is looking for a non-destructive solution, here’s how you can disable the coupon entry form ONLY when there are no active coupons.  When you add a new “Shopping Cart Sales Rule” and make it active, the form will be displayed.

Open the template file that is responsible for the coupon display form:

/app/design/frontend/<your-package>/<your-theme>/template/checkout/cart/coupon.phtml

Add the following PHP to the top of the file, below the Magento license info, before any HTML is output.

<?php
// if there are no active "Shopping Cart Price rules"
// then don't need to display the coupon entry form
$activeSalesRules Mage::getModel('salesrule/rule')
    ->
getCollection()
    ->
addFieldToSelect('rule_id')
    ->
addFieldToFilter('is_active'1)
    ->
getData();
    
if(empty(
$activeSalesRules)) return;
?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
xogenics
Member
 
Avatar
Total Posts:  35
Joined:  2011-10-17
Netherlands
 

I know, I know.. it’s late, but for anyone browsing the forums; no need to dive into the code to fix this anymore! We offer a FREE extension:

The free “Clean Carts” extension allows you to individually disable the shipping estimate and coupon code boxes in your shopping cart. Whenever you think these features need to be shown again, simply enable either or both.

Image Attachments
Clean-Carts_03.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
iccdesig
Jr. Member
 
Total Posts:  5
Joined:  2011-11-29
 

I created app/design/frontend/<theme>/default/layout/local.xml and added the following lines:

<?xml version="1.0" encoding="utf-8"?>
<layout>
<checkout_cart_index>
<remove name="checkout.cart.coupon" /> <!--discount codes-->
</checkout_cart_index>
</layout>

 
Magento Community Magento Community
Magento Community
Magento Community
 
jobschouten
Jr. Member
 
Total Posts:  1
Joined:  2011-04-29
 
iccdesig - 22 December 2011 01:21 PM

I created app/design/frontend/<theme>/default/layout/local.xml and added the following lines:

<?xml version="1.0" encoding="utf-8"?>
<layout>
<checkout_cart_index>
<remove name="checkout.cart.coupon" /> <!--discount codes-->
</checkout_cart_index>
</layout>

This works, and seems to be a -clean- way of dealing with these items.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sentis
Jr. Member
 
Total Posts:  16
Joined:  2009-04-17
 

Works fine on 1.6.1. Thanks for this solution!

 
Magento Community Magento Community
Magento Community
Magento Community
 
volition
Jr. Member
 
Avatar
Total Posts:  2
Joined:  2011-08-17
 

So, I just pulled the entire coupon.phtml file out of my directory and it seems to work just fine on IE 9, Safari and Firefox.  No more discount code box popping up in my checkout cart.  Just my shipping estimate calculator like I want.

My directory was… app / design / frontend / base / default / template / checkout / cart / coupon.phtml

I’m using Magento 1.5.1.0 and have a different custom theme.

Anything I should be worried about by doing this method?  Doesn’t look like it has broken anything ( or will break anything).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Evenclothing
Jr. Member
 
Total Posts:  3
Joined:  2012-08-08
 

I have sponsored athletes that get a code for a % discount off of product.
But i want to diable there code when i am adding a discount for just reg customers.
For example if i am offering 25% off o winter gear . I dont want our athlete to put in his code and get another &#x15; off making it 30% off of the product now.
Does this make sense?

 
Magento Community Magento Community
Magento Community
Magento Community
 
topicrentals
Jr. Member
 
Total Posts:  11
Joined:  2012-07-06
 

Great solution, worked like a charm.  Thank you!

iccdesig - 22 December 2011 01:21 PM

I created app/design/frontend/<theme>/default/layout/local.xml and added the following lines:

<?xml version="1.0" encoding="utf-8"?>
<layout>
<checkout_cart_index>
<remove name="checkout.cart.coupon" /> <!--discount codes-->
</checkout_cart_index>
</layout>

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2