skip to Main Content

I am trying to show my categories in home page within a slider, that redirects to the relevant category page ?

2

Answers


  1. {{block type="catalog/product_list" category_id="YOUR_CATEGORY" template="catalog/product/list.phtml"}}
    

    Step:- Need to put code in cms home page.and Put your category id in block.

    Step2:- Here is the code of slider.

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script src="jquery.bxslider.min.js"></script>
    
      <ul class="bxslider">
         <li>Call block here </li>
    
    </ul>
    <script>
      jQuery('.bxslider').bxSlider({
      mode: 'fade',
      captions: true
     });
    </script>
    
    Login or Signup to reply.
  2. Ist you need to create a custom Phtml file
    then use this code

    <?php 
    $_helper = Mage::helper('catalog/category');
    $_categories = $_helper->getStoreCategories();
    if (count($_categories) > 0){
        foreach($_categories as $_category){
            $_category = Mage::getModel('catalog/category')->load($_category->getId());
            $_subcategories = $_category->getChildrenCategories();
            if (count($_subcategories) > 0){
                echo $_category->getName();
                echo $_category->getId();      
                foreach($_subcategories as $_subcategory){
                     echo $_subcategory->getName();
                     echo $_subcategory->getId();
                }
            }
        }
    }
    ?>
    

    Call it on your homepage then you can easily do HTML and slider what you want
    if you want more help you can ask me

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search