In this post you will learn how you can export Magento 1.9 categories for a specific store view as CSV. For example, you have Arabic store view with ID 7, and you want to export all arabic category names in a CSV file, below will be the code you want. Create a file on your Magento root and paste the below code, change the $storeId to your desired ID and run the script. After running the above script, you will find the exported CSV file `categories_arabic.csv` in the directory `var/export/` <?php require_once 'app/Mage.php'; Mage::app("admin"); $storeId = 7; $categories = Mage::getModel('catalog/category') ->getCollection() ->setStoreId($storeId) ->addFieldToFilter('is_active', 1) ->addAttributeToSelect('*'); $handle = fopen("var/export/categories_arabic.csv", "w"); $header = array('ID', 'Name'); fputcsv($handle, $header); foreach($categories as $category){ $row = array($category->getId(), $category->getName()); fputcsv($handle, $row); } fclose($handle); ?>
Magento 1: Export Catalog Categories by Store View
In this post you will learn how you can export Magento 1.9 categories for a specific store view as CSV. For example, you have Arabic store view with ID 7, and y
Related posts
Magento
Set Magento store's base link URL programmatically
Learn how to set Magento’s base link URL programmatically using the setup installer. This guide explains base_link_url vs. base_url, store-specific configuration, secure and unsecure URLs, common errors, troubleshooting, and best practices for managing Magento URL settings.
Magento
Set Magento Template, Skin & Layout
[code language=”php”] $groups[‘theme’][‘fields’][‘template’][‘value’] = ‘template_name’;
Magento
Magento get store by storecode
Learn how to efficiently retrieve a Magento 1 store by its unique store code without unnecessary loops. This guide explains how to use Magento’s built-in Mage::app()->getStore() method, handle invalid store codes safely, and improve code performance and memory efficiency in multi-store environments.