0

I am working on one website multi store functionality. I am having store view ids in my array, i want to get all categories by store view id arrays.

2
  • are you want particulat once store_view category ids or multil store view categories list?
    – Amit Bera
    Oct 6, 2015 at 9:28
  • I want all active child categories list by store view ids.
    – Mathew
    Oct 6, 2015 at 9:54

2 Answers 2

0
$categories = Mage::getModel('catalog/category')
                ->getCollection()
                ->addFieldToFilter('is_active', 1);


print_r($categories->getAllIds());
-1

You can click refer following code..

<?php
  require_once("app/Mage.php");
  Mage::app('default');
  Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
  try
  {
    $entityType = Mage::getModel('catalog/product')->getResource()->getTypeId();
    $collection = Mage::getResourceModel('eav/entity_attribute_set_collection')->setEntityTypeFilter($entityType);
    $allSet = array();
    foreach($collection as $coll)
    {
      $attributeSet['name'] = $coll->getAttributeSetName();
      $attributeSet['id'] = $coll->getAttributeSetId();
      $allSet[] = $attributeSet;
    }
    Mage::log($allSet,1,'allSet.log');//make sure you have enabled log fron backend
    print_r($allSet);
    $attributeType = Mage::getModel('eav/entity_type')->loadByCode(Mage_Catalog_Model_Product::ENTITY);
    $attributeCollection = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter($attributeType);
    $allAttributes = array();
    foreach($attributeCollection as $coll)
    {
        Mage::log($coll,1,'coll.log');
        $attribute['name'] = $coll->getAttributeCode();
        $attribute['id'] = $coll->getAttributeId();
        $allAttributes[] = $attribute;
    }
    Mage::log($allAttributes,1,'allAttributes.log');//make sure you have enabled log fron backend
    print_r($allAttributes);
  }catch(Exception $e){
  echo $e;
  }
?>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.