Skip to main content

Posts

Showing posts from September 20, 2014

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

Display Categories in Magento

Here, I will show you how you can get list of all categories of your Magento Shop. You might want to display all categories in homepage or any CMS page. There are different ways to get the category listing. Here are some:- Get all categories The following code will fetch all categories (both active and inactive) that are present in your Magento Shop. $categories   = Mage::getModel( 'catalog/category' )                      ->getCollection()                      ->addAttributeToSelect( '*' ); Get all active categories The following code will fetch all active categories that are present in your Magento Shop. Thus filtering the inactive categories. $categories   = Mage::getModel( 'catalog/category' )                      ->getCollection()                      ->addAttributeToSelect( '*' )                      ->addIsActiveFilter(); Get active categories of any particular level The following code w

MySQL query get first and last day of month

# For current month SELECT DATE_FORMAT(CURDATE(), '%Y-%m-01') AS `First Day Of Current Month`; SELECT LAST_DAY(CURDATE()) AS `Last Day Of Current Month`; # For previous month SELECT DATE_FORMAT(CURDATE() - INTERVAL 1 MONTH, '%Y-%m-01') AS `First Day Of Previous Month`; SELECT LAST_DAY(CURDATE() - INTERVAL 1 MONTH) AS `Last Day Of Previous Month`; # For next month SELECT DATE_FORMAT(CURDATE() + INTERVAL 1 MONTH, '%Y-%m-01') AS `First Day Of Next Month`; SELECT LAST_DAY(CURDATE() + INTERVAL 1 MONTH) AS `Last Day Of Next Month`;

Magento : onepage checkout scrolling issue.

Open opcheckout.js and find gotoSection function and replace this function as follow. gotoSection: function(section) { var sectionElement = $('opc-'+section); sectionElement.addClassName('allow'); this.accordion.openSection('opc-'+section); this.reloadProgressBlock(section); jQuery("html, body").delay(10).animate({scrollTop: jQuery("#opc-"+section).offset().top }, 1000); },

Magento Observer Event list

File Line Event /app/code/core/Mage/Admin/Model/Session.php 104 admin_session_user_login_success /app/code/core/Mage/Admin/Model/Session.php 112 admin_session_user_login_failed /app/code/core/Mage/Admin/Model/User.php 337 admin_user_authenticate_before /app/code/core/Mage/Admin/Model/User.php 354 admin_user_authenticate_after /app/code/core/Mage/Adminhtml/Block/Api/User.php 52 api_user_html_before /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php 160 adminhtml_catalog_category_edit_prepare_form /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php 157 adminhtml_catalog_category_tabs /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 291 adminhtml_catalog_category_tree_is_moveable /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 328 adminhtml_catalog_category_tree_can_add_root_category /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 348 adminhtml_catalog_category_tree_can_add_sub_category /app/code/core/Ma