2

Using 1.9.0.1

Here is the situation:

  • not logged in

  • adding some product to cart (no problem)

  • go to "view cart"

  • fields: image, description, edit, unit price, qty, subtotal, remove

Situation 2:

  • logged in now

  • adding some product to cart (no problem)

  • go to "view cart"

  • fields: image, description, edit, add to wishlist!!!, unit price, qty, subtotal, remove

How do i get rid of the add to wishlist from this?

I know i can set display none using like this: .cart-table th:nth-child(3), .cart-table td:nth-child(3), .cart-table th:nth-child(4), .cart-table td:nth-child(4) { display: none; }

BUT...

when i do this it works great for when NOT LOGGED IN, and when LOGGED IN, it added an extra th so it is messed up...

Anyone know where i can safely delete that add to wishlist function from cart view?

Thanks

7

You have 2 options here.
Option 1.
Edit all cart and cart item templates and remove the wishlist column.
For this you need to edit:

  • checkout/cart.phtml
  • checkout/cart/item/default.phtml
  • downloadable/checkout/cart/item/default.phtml

Option 2
Override the Mage_Wishlist_Helper_Data::isAllowInCart method and make it return false always.
For this second option you need a new module. Let's call it Easylife_Wishlist. Create these files:

app/etc/modules/Easylife_Wishlist.xml - the declaration file:

<?xml version="1.0"?>
<config>
    <modules>
        <Easylife_Wishlist>
            <codePool>local</codePool>
            <active>true</active>
            <depends>
                <Mage_Wishlist />
            </depends>
        </Easylife_Wishlist>
    </modules>
</config>

app/code/local/Easylife/Wishlist/etc/config.xml - the configuration file

<?xml version="1.0"?>
<config>
    <modules>
        <Easylife_Wishlist>
            <version>1.0.0</version>
        </Easylife_Wishlist>
    </modules>
    <global>
        <helpers>
            <wishlist>
                <rewrite>
                    <data>Easylife_Wishlist_Helper_Data</data> <!-- tell magento to use your own helper instead of the default one -->
                </rewrite>
            </wishlist>
        </helpers>
    </global>
</config>

app/code/local/Easylife/Wishlist/Helper/Data.php - your new helper

<?php 
class Easylife_Wishlist_Helper_Data extends Mage_Wishlist_Helper_Data 
{
    public function isAllowInCart()
    {
        return false;
    }
}

Clear the cache, disable compilation if enabled and you are done.

|improve this answer|||||
  • wow, gonna try that... very exciting (never did something like this) – carlo Nov 10 '14 at 13:56
  • I followed this procedure and it works PERFECT!!!! Your the best... this was very easy to follow – carlo Nov 10 '14 at 14:15
  • Can it be that this is causing te attributes not to appear in wishlist itself anymore? selling jewelry it should have the material/color in it... thanks – carlo Nov 10 '14 at 21:05
  • I don't think the extension above has anything to do with it. But you can disable it by setting in app/etc/modules/Easylife_Wishlist.xml the <active> tag to false. If by some strange correlation that I'm missing my code screws up your wishlist, you can try the first approach. – Marius Nov 11 '14 at 8:02
  • @carlo. I double checked. The method that is overwritten in the code I provided is used only in the templates to see if the 'move to wishlist' checkbox should appear or not. It does not affect the logic of the application. Just the presentation. – Marius Nov 11 '14 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.