Skip to main content

Need Mini Shopping Cart in Header

<div id="cartsummary">
      
       Now in your cart :<br />
       <a href="<?php echo $this->getUrl('checkout/cart/')?>">
            <?php 
    $count = $this->helper('checkout/cart')->getSummaryCount();  //get total items in cart 
      $total = $this->helper('checkout/cart')->getQuote()->getGrandTotal(); //get total price 
      if($count==0) 
      { 
      echo "0 item";
      } 
      if($count==1) 
      { 
        echo $this->__(' %s items',$count); 
      } 
      if($count>1) 
      { 
        echo $this->__(' %s item',$count); 
      }
  ?>
           </a>
          </div>

Comments

Popular posts from this blog

Fixing a Compiler Error in Magento

Fortunately the compiler is quite easy to manually disable. This will resolve the compiler issue and allow you to access your Magento Admin so that you can re-compile before enabling the compiler again. Access your Magento website using FTP and open the file /includes/config.php . You should see the following code: ------------------------------------------------------------------------------------------------------- define ( 'COMPILER_INCLUDE_PATH' , dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . 'src' ) ; define ( 'COMPILER_COLLECT_PATH' , dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . 'stat' ) ; ------------------------------------------------------------------------------ This code tells Magento where to look for the compiled files. To disable the compiler, simply comment out these lines (add a '#' character to the start of each line). The result should look like the following: ------------------------------------------------...

Magento - Ajax add to cart and quantity box in list.phtml

 To add quantity box with increment + and - and also using ajax add to cart, you should first take the quantity increment box with CSS styling and also need to include a dynamic form (multiple forms per product) as shown in the below code : <ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col">   <?php $i=0; foreach ($_productCollection as $_product): ?>   <?php if ($i++%$_columnCount==0): ?>   <?php endif ?>   <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">     <form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form_<?php echo $_product->getId()?>"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>       <script type="text/javascript">   ...

Output more than one image per product on list (category page) of Magento.

//get images for product $product = Mage::getModel('catalog/product')->load($_product->getId()); $helper = Mage::Helper('catalog/image'); foreach ($product->getMediaGalleryImages() as $image) {     echo "<img src='" . $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $image->getFile())->resize(243) . "' />"; } ?>