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

Detach the amout of items in shopping cart, from the link
 
Michal_s
Sr. Member
 
Total Posts:  111
Joined:  2008-05-15
The Netherlands
 

Ok, i was wondering if someone knows how to detach the amout of items from the shopping cart link…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michal_s
Sr. Member
 
Total Posts:  111
Joined:  2008-05-15
The Netherlands
 

is there then maybe someone who know which php files creates these links?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

app/code/core/Mage/Checkout/Block/Link.php

public function addCartLink()
    
{
        
if ($parentBlock $this->getParentBlock()) {
            $count 
$this->helper('checkout/cart')->getSummaryCount();

            if( 
$count == {
                $text 
$this->__('My Cart (%s item)'$count);
            
elseif( $count {
                $text 
$this->__('My Cart (%s items)'$count);
            
else {
                $text 
$this->__('My Cart');
            
}

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

    
public function addCheckoutLink()
    
{
        
if (!$this->helper('checkout')->canOnepageCheckout()) {
            
return $this;
        
}
        
if ($parentBlock $this->getParentBlock()) {
            $text 
$this->__('Checkout');
            
$parentBlock->addLink($text'checkout'$texttrue, array(), 60null'class="top-link-checkout"');
        
}
        
return $this;
    
}
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

anywhere you want to display the count of items in the cart, use this line:

$count $this->helper('checkout/cart')->getSummaryCount();
//$count will be your number of items
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top