i'm working with Magento ver. and magento boilerplate theme. i want to change the top link text with icons.but unable to find the file.

Here is the code inside my app/code/core/Mage/Checkout/Block/links.php

public function addCartLink()
        $parentBlock = $this->getParentBlock();
        if ($parentBlock && Mage::helper('core')->isModuleOutputEnabled('Mage_Checkout')) {
            $count = $this->getSummaryQty() ? $this->getSummaryQty()
                : $this->helper('checkout/cart')->getSummaryCount();
            if ($count == 1) {
                $text = $this->__('My Cart (%s item)', $count);
            } elseif ($count > 0) {
                $text = $this->__('My Cart (%s items)', $count);
            } else {
                $text = $this->__('My Cart');

            $parentBlock->addLink($text, 'checkout/cart', $text, true, array(), 50, null, 'class="top-link-cart"');
        return $this;

1 Answer 1


As you can see in this line

$parentBlock->addLink($text, 'checkout/cart', $text, true, array(), 50, null, 'class="top-link-cart"');

the class name top-link-cart is added to the cart link.
Do your magic via css. It should be the easiest way to do it.
I'm not much of a css expert (not even close) but I think you can hook on this class and set a background image, hide the text, give it a width and height and problem solved.

  • 1
    To expand on Marius his CSS magic: The easiest way to do this is using icon fonts. You can find them on sites like weloveiconfonts.com or create them your self. Oct 15, 2014 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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