Reputation: 256
I have created a product import script which parse csv and import simple products. which is quite easy and there is lot of help available on it. The real problem is when i set them for different multiple storefronts.
$websites = Mage::getModel('core/website')->getCollection()->setLoadDefault(false);
$websiteLookup = array();
foreach ($websites as $website) {
$websiteLookup[$website->getCode()] = $website->getWebsiteId();
}
$product->setWebsiteIds($websiteLookup)->save();
Question is, How could i set product titles and product descriptions for each storefront while adding product?
$product->setDescription("DESCRIPTION HERE");
Does above function for setting Description takes array with store ids or is there another way around. Immediate help will be appreciated.
Upvotes: 0
Views: 970
Reputation: 1590
I recomend you read the functions
_initProduct()
_initProductSave()
saveAction()
in
class Mage_Adminhtml_Catalog_ProductController
Which covers how Magento does it.
You can capture the POST data by creating a test product in the Magento admin area, pressing the save button and inspecting the POST data sent back to Magento (or by sticking a quick var_dump
in saveAction()
)
Upvotes: 2