Monday 27 April 2015

How to Show popular search terms in sidebar Magento

How to Show popular search terms in sidebar Magento


Hello In you need to add popular search in your sidebar.

if you add code this code in local.xml file or catalog.xml file when to add block for side bar.

<block type="catalogsearch/term" after="tags_popular" name="catalogsearch.term" template="catalogsearch/term.phtml"/>

here i am added left sidebar in code

<reference name="left">
   <block type="catalogsearch/term" after="tags_popular" name="catalogsearch.term" template="catalogsearch/term.phtml"/>
   </reference>

Please use it. 

Thursday 23 April 2015

how to get store information in magento?

how to get store information in magento?


Hello Herer Some Function To use how to get store value in your phtml file.

1)

Get Current page URL of Store

Mage::app()->getStore()->getCurrentUrl();

2)

Get store data

Mage::app()->getStore();

3)

Store Id

Mage::app()->getStore()->getStoreId();

4)

Get  Store code

Mage::app()->getStore()->getCode();

5)


Get Website Id

Mage::app()->getStore()->getWebsiteId();


6)

Is Active store get 

Mage::app()->getStore()->getIsActive();

7)


Get Homepage URL of Store

Mage::app()->getStore()->getHomeUrl();








Sunday 19 April 2015

how to get new root category of sub category in magento and display navigation in menu

how to get new root category of sub category in magento


$root_category = Mage::getModel('catalog/category')->load(7); // Put your root category ID here.

  $subcategories = $root_category->getChildren();?>

  

  <ul class="cat_list">
 
  <?php foreach(explode(',',$subcategories) as $subcategory) {

        $category = Mage::getModel('catalog/category')->load($subcategory);?>

echo $category->getName()?></a></li>

 <?php }?>

  </ul>

this will help you new root category get child cateogry check it

if you want to add new root category in your menu then 
just do and follow step

Go to Admin -> Catalog -> Manage Categories -> "Select Category" -> Display Settings -> Is Anchor = "Yes"

Then:

Admin -> System -> Index Management -> "Select All" -> "Reindex data" -> "Submit"

get defualt root category any where

Mage::app()->getStore("default")->getRootCategoryId()

any new root category then

Mage::app()->getStore($storeId)->getRootCategoryId();

Friday 17 April 2015

remove index.php in url in magento

remove index.php in url in magento 


Hello

Here simple to remove index.php in your url in magento.

just follow few step it's done.

here you want to remove index.php in frontend url

step 1 goto Configuration
step 2 goto  Web 
step3 goto Search Engines Optimizations and select yes

simple Configuration -> Web -> Search Engines Optimizations, select YES
it's working 
second is System -> Configuration -> Web -> Secure -> Use secure URLs select yes.

i hope it's working give suggest i any new thing.

remove index.php in magento


Wednesday 15 April 2015

create custom loader in jquery and css

<script type="text/javascript">
$(document).ready(function(){
   
     jQuery('#link').click(function(){
       
     var link_value =  jQuery(this).attr('value');
     //alert(link_value);
     pagination(link_value);
     
});
   
});

function pagination(link_value){
   
    jQuery("#ldr").show();
    jQuery.ajax({
    type: "GET",
    url: "http://example.com/",
    dataType : "html",
    data: {link_value: link_value},
    success: function(response){
    jQuery('.gallery').html(response);
    jQuery("#ldr").hide();
    },
});
     
   
}
</script>
<div id="ldr" style="z-index: 99999999;display: none; position: fixed; height: 100%; width: 100%; background: url("http://www.example.com/image/ajax_loader_blue_512.gif") no-repeat scroll center center rgba(0, 0, 0, 0.5);">
</div>
<label value="20" id="link">20
<div class="gallery"></div>

Monday 13 April 2015

Set your custom temple in your cms page or using xml file magento

Set your custom temple in your cms page or using xml file

Hello

In Cms Page

Step 1: Goto Cms -> Pages

In add new page or edit your page

Step 2 : In cms page goto -> Design tab

in layout upadate




step3. save

page







cms page tempalte

Friday 3 April 2015

How to add static block call in phtml,xml and cms page in magento

How to add static block call in phtml,xml and cms page in magento


Hello Here sample code add static block in phtml,xml  and cms page.

In your Phtml File in magento


<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('set your block id')->toHtml() ?>

herer set i am setting my block

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block-header-top1')->toHtml() ?>

In your xml file

  <reference name="content">
    <block type="cms/block" name="home-page-block">
      <action method="setBlockId">add your block id
    </block>
  </reference>

In Your cms page

{{block type="cms/block" block_id="add your block id "}}

I hope this blog help you to add static block in your magento  any suggetion for me please comment it.