Skip to main content

Posts

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: ------------------------------------------------
Recent posts

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) . "' />"; } ?>

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">          

Smooth Page Scroll Script

< script > $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')  && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); </ script >

Magento-local.xml-Template

<?xml version="1.0"?> <layout>         <!-- Add/Remove Items From Head -->     <default translate="label" module="page">     <reference name="head">         <!-- Add Javascript File -->                 <action method="addItem">         <type>skin_js</type>         <name>js/jquery.js</name>         <params/>         </action>         <!-- Add CSS File -->         <action method="addCss">         <stylesheet>css/local.css</stylesheet>         </action>         </reference>         </default>                 <!-- Default layout, loads most of the pages -->         <default>                     <!-- Add Custom Block     <reference name="root">       <block type="core/template" before="-" name="my_block" as="my_block" template="path/to

Remove Category option from Layered Navigation options list in magnto

This is about how to remove the category from the layered navgation Please open to app/design/frontend/default/default/template/catalog/layer and open up view.phtml for edit.  < dl id = "narrow-by-list" > <?php $_filters  =  $this -> getFilters ()  ?> <?php  foreach ( $_filters  as  $_filter ):  ?>  <?php  if( $_filter -> getItemsCount ()):  ?> <?php  if( $_filter -> getName () !=  "Category" ) { ?> < dt > <?php  echo  $this -> __ ( $_filter -> getName ())  ?> </ dt > < dd > <?php  echo  $_filter -> getHtml ()  ?> </ dd > <?php }  endif;  ?> <?php  endforeach;  ?> </ dl >