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
Get custom attribute value in Magento
Learn how to safely get custom attribute values in Magento 1 using <code>getData()</code>, <code>getAttributeText()</code>, and Magento's resource model. This guide explains how to retrieve raw and frontend attribute values, handle dropdown attributes, prevent <code>getSource()</code> fatal errors, and safely work with custom product attributes.
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’;