2/21/2012

GET CKEDITOR VALUE JQUERY

   jQuery("#cke_contents_comments iframe").contents().find("body").text();

In my case the textarea id was comments so i have used #cke_contents_comments

2/15/2012

jQuery restrict upload file types

  var  ExtensionList = ['jpeg', 'jpg', 'png', 'gif', 'bmp'];

           jQuery("#file").change(function () {

               if (jQuery.inArray(jQuery(this).val().split('.').pop().toLowerCase(),  ExtensionList  ) == -1) {

                   alert("Only \'jpeg\', \'jpg\', \'png\', \'gif\', \'bmp\' are allowed.");
  jQuery(this).val('');

               }
               });

2/14/2012

SET DEFAULT STORE VIEW FOR CATEGORY AND PRODUCT LIST IN ADMIN MAGENTO


adminhtml/default/default/template/store/switcher.phtml
CHANGE  THE FOLLOWING LINE OF  CODE
<option value="<?php echo $store->getId() ?>"<?php if($this->getStoreId() == $store->getId()): ?> selected="selected"<?php endif; ?>>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $store->getName() ?></option>


TO



<option value="<?php echo $store->getId() ?>"<?php if($this->getStoreId() == $store->getId()): ?> selected="selected"<?php elseif($store->getId()==4):echo "selected='selected'"; endif; ?>>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $store->getName() ?></option>

PROTOTYPE /JQUERY CONFLICT IN MAGENTO.

  To rectify the error just open the jquery’s js file ,scroll down to bottom and write
  jQuery.noConflict();
 at the end of file.

REMOVE WARNING : event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.


Use the following code:
jQuery(function(){
    // remove layerX and layerY
    var all = jQuery.event.props,
        len = all.length,
        res = [];
    while (len--) {
      var el = all[len];
      if (el != 'layerX' && el != 'layerY') res.push(el);
    }
    jQuery.event.props = res;
}());

Using toplinks in footer or in any phtml file

 <?=$this->getLayout()->getBlock('top.links')->toHtml()?>

Removing cart from magento home page