Skip to main content

Posts

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 ); } }

Calculate the days difference between two dates using Jquery

$(document).ready(function () { $("#date1").datepicker({ minDate: new Date(2012, 7 - 1, 8), maxDate: new Date(2012, 7 - 1, 28) }); //$("#date2").datepicker({ minDate: new Date(2012, 7 - 1, 9), maxDate: //new Date(2012, 7 - 1, 28) });    $('#date1, #date2').datepicker({onSelect: function(dateStr) {       var d1 = $('#date1').datepicker('getDate');       var d2 = $('#date2').datepicker('getDate');       var diff = 0;       if (d1 && d2) {             diff = Math.floor((d2.getTime() - d1.getTime()) / 86400000); // ms per day       }       $('#calculated').val(diff); } }); }); Check Js Fiddle :  http://jsfiddle.net/MebwN/48/

Cache_dir must be a dir in Magento

This problem usually occurs when we move our site from one server to other, There are two solutions for this problem, Solution 1: Go to this location lib/Zend/Cache/Backend/ and open file.php  file you’ll see the code something like this protected $_options = array ( 'cache_dir' => null , 'file_locking' => true , 'read_control' => true , 'read_control_type' => 'crc32' , 'hashed_directory_level' => 0 , 'hashed_directory_umask' => 0700 , 'file_name_prefix' => 'zend_cache' , 'cache_file_umask' => 0600 , 'metadatas_array_max_size' => 100 ); change this code as below protected $_options = array ( 'cache_dir' => '/tmp' , 'file_locking' => true , 'read_control' => true , 'read_control