How can I create a magento data feed?
To create magento data feed file by default you need to have some certain skills in programming. In default Magento it is posible to create a feed file only in CSV format. Magento has an integrated ?php class to work with CSV.
To create CSV file you need to use php class Varien_File_Csv:
$file_path = "sample.csv";
$mage_csv = new Varien_File_Csv();
$products_ids = array(1,2,3);
$products_model = Mage::getModel('catalog/product');
$products_row = array(); foreach ($products_ids as $pid)
{
? ? $prod = $products_model->load($pid);
? ? $data = array();
? ? $data['sku'] = $prod->getSku(); ? ?
? ? $data['name'] = $prod->getName();
? ? $data['price'] = $prod->getPrice();
? ? $products_row[] = $data;
}
$mage_csv->saveData($file_path, $products_row);
Default Magento is very limited with functionality. ?To make a quality product export you need to install an additional extension that is more flexible with settings and able to support popular file formats as XML and TXT. We recomend you to have one of our extension Advanced Product Feed. This extension allows you to quickly create magento data feed file in a popular format ?xml, txt. To work with this extension you dont need to have an additional skills in programming.
To create magento data feed file with Advanced Product Feeds for Google Shopping:
First of all import a template, to have this done go to ?Catalog > Manage Feeds > Manage Tamplates, and press ??Import Templates?.
Choose Google Shopping template and press ?Import Templates?.
Next go to Catalog > Manage Feeds > Manage Feeds press ?Add Feed?.
Choose Google Shopping template.
In line "Filename" write feed name, and specify the Type File and in the tab "Is Active" select ?Yes?.
Go to tab "Filter" and create rules, which you will use to filter products. An extension offers you to choose a Base Product Filter or to create your own. You can do that to press ?Create New Product Filter?.
In a pop up window in line ?Name? enter the name of filter, in line ??Is Active? choose ?Yes?
After that go to tab "Rules" and add the terms to filter.?Than you should press ?Save Filter?.
?
?
And after that press ?Generate Feed?.
After you will be done with all the actions above you will get a ready Magento Data Feed file, that you need to add on shoping platform.