This post will guide you on how you can export the manufacturer list (Magento 1.9) to CSV file. Navigate to your `var/export` folder and find the `manufacturers.csv`. Please post your questions and queries in the comments box below.
In this script, I am filtering the list by store view. Let’s suppose you have a store view for Arabic (Store ID=1) and you want to export the manufacturer (Attribute ID= 555) list in Arabic labels only.
The below script will be helpful for you. <?php require_once 'app/Mage.php'; Mage::app("admin"); $manufacturer_attribute_id = 555; // Change attribute id as per your store setup $storeId = 7; // Punch the store id for which you want to export the data $collection = Mage::getResourceModel('eav/entity_attribute_option_collection') ->setAttributeFilter($manufacturer_attribute_id) ->setStoreFilter($storeId, false); $handle = fopen("var/export/manufacturers.csv", "w"); $header = array('ID', 'Name'); fputcsv($handle, $header); foreach($collection as $manufacturer){ $row = array($manufacturer->getOptionId(), $manufacturer->getValue()); fputcsv($handle, $row); } fclose($handle); ?>
Magento 1: Export Manufacturers CSV by Store View
This post will guide you on how you can export the manufacturer list (Magento 1.9) to CSV file. In this script, I am filtering the list by store view. Let’
Related posts
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.
Magento
Magento: Render static block in a phtml file
Learn how to render a Magento 1 static block directly inside a PHTML template using the cms/block block type. This guide covers how to create and load CMS static blocks, use block identifiers, render content with PHP, troubleshoot common display issues, and choose between PHTML, layout XML, and CMS directives.
Magento
How to change Magento Base URL
Learn how to configure and change the Magento Base URL, secure and unsecure URLs, HTTPS settings, domain migrations, localhost installations, and common URL problems. This guide also covers cache clearing, database updates, and essential SEO checks after changing your Magento store URL.