Skip to main content

Posts

Get product Image in Top Menu in magento 1.9.1

app\code\local\Mage\Catalog\Model\Observer.php find function _addCategoriesToMenu() replace $categoryData = array(                 'name' => $category->getName(),             'id' => $nodeId,             'url' => Mage::helper('catalog/category')->getCategoryUrl($category),             'is_active' => $this->_isActiveMenuCategory($category),             'thumbnail' => Mage::getModel('catalog/category')->load($category->getId())->getImage()             ); app\code\local\Mage\Page\Block\Html\Topmenu.php find function getHtml() remove  if ($renderer = $this->getChild('catalog.topnav.renderer')) {             $renderer->setMenuTree($this->_menu)->setChildrenWrapClass($childrenWrapClass);             $html = $renderer->toHtml();         } else {             $html = $this->_getHtml($this->_menu, $childrenWrapClass);         } add $html = $this->_

How to Show product Price in product List page

first add this code block after list or grid mode wherever you want <?php if($_product->isConfigurable()): ?>  <?php $attributes = $_product->getTypeInstance(true)->getConfigurableAttributes($_product) ?>  <?php if(count($attributes)): ?> <?php foreach($attributes as $att): ?>  <?php $pAtt=$att->getProductAttribute(); //get the child products $allProducts = $_product->getTypeInstance(true)->getUsedProducts(null, $_product); $frontValues =array() ?>   <?php //echo $pAtt->getFrontendLabel() ?>   <?php foreach($allProducts as $p): ?>  <?php if(!$p->isSaleable()) continue; ?> <?php $out=$p->getAttributeText($pAtt->getName()); ?> <?php $frontValues[$out]=$out; ?>   <?php endforeach ?> <?php endforeach ?> <?php endif ?> <?php endif ?> <?php /* if ($_product->getData('type_id')

Ajax In Magento using module

Write your code to hit the module in script tag <script> function api(id){ jQuery.ajax({ type: "POST", url: "<?php echo $this->getUrl('ankur') ?>", data: { id : id } }) .done(function( msg ) { //alert( "Data Saved: " + msg ); }); } </script> Now create a module  location: /public_html/app/code/local module name(create folders):Excellence\Test\controllers/IndexController.php <?php class Excellence_Test_IndexController extends Mage_Core_Controller_Front_Action{ public function indexAction(){ // Write here ajax action, what you want to do... } } ?> now create another folder Excellence\Test\etc\config.xml <?xml version="1.0"?> <config>     <modules>         <Excellence_Test>             <version>0.1.0</version>    <!-- Version of module -->         </Excellence_Test>     </modules>     <frontend>

Custom Import function in magento

Open the file  app\code\local\mainModule\moduleName\Block\Adminhtml\moduleName.php Add or replace  public function __construct() { $this->_controller = "adminhtml_myoffer"; $this->_blockGroup = "myoffer"; $this->_headerText = Mage::helper("myoffer")->__("Myoffer Manager"); $this->_addButtonLabel = Mage::helper("myoffer")->__("Add New Item"); $this->_addButton('testbutton', array(             'label'     => Mage::helper('Sales')->__('Import'),             'onclick'   => 'jsfunction(this.id)',             'class'     => 'go'         ), 0, 100, 'header', 'header'); parent::__construct(); } And add a java script on same page <script> function jsfunction(){ window.open("http://localhost/ankur/yourPageName.php",'_blank','width=335,height=330,resizable=1');

NEW FEATURES IN THE LATEST MAGENTO RELEASE – ENTERPRISE EDITION 1.14 & MAGENTO COMMUNITY EDITION 1.9

NEW FEATURES IN THE LATEST MAGENTO RELEASE – ENTERPRISE EDITION 1.14 & MAGENTO COMMUNITY EDITION 1.9 The new version of Magento Enterprise and Magento Community Edition was launched at the 2014 Global Imagine Ecommerce Conference in Las Vegas. The release of the newest versions of  Magento Enterprise Edition version 1.14  and  Magento Community Edition version 1.9  introduced numerous features with which Magento based websites can be better managed and which help all Magento users to manage their Magento based websites more competently. 1.- RESPONSIVE WEB DESIGN TEMPLATE ( Images from  New Features in Magento Community Edition (CE) 1.9 and Magento Enterprise Edition (EE) 1.14  by Magento) The default theme uses Responsive Web Design for a tablet and smart phone-friendly site Retailers are now able to obtain a tablet- and smartphone-friendly responsive site in approximately half the time as previously required, taking advantage of the rapid growth in mobile commerce. M

How to Display Custom Options in Magento

$productSku = "ABCDE" ; $product = Mage :: getModel ( 'catalog/product' ); $productId = $product -> getIdBySku ( $productSku ); $product -> load ( $productId ); /** * In Magento Models or database schema level, the product's  Custom Options are * executed & maintained as only "options". So, when checking  whether any product has * Custom Options or not, we should check by using this method  "hasOptions()" only. */ if ( $product -> hasOptions ()) { echo '<pre>' ; foreach ( $product -> getOptions () as $o ) { $optionType = $o -> getType (); echo 'Type = ' . $optionType ; if ( $optionType == 'drop_down' ) { $values = $o -> getValues (); foreach ( $values as $k => $v ) { print_r ( $v ); } } else { print_r ( $o ); } }