Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Need help to add tier price
 
abosalam
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2008-04-25
 

I am trying to read around 9000 products from an xml file to add them to magento database. I need help to know how to add tier prices to each product. This code works fine to add products but the tier price is missing.

$row = array (
    
'sku'                           => '444',
    
'store'                         => 0,
    
'attribute_set'                 => 'Default',
    
'type'                          => 'Simple Product',
    
'categories'                    => '14',
    
'name'                          => 'test',
    
'description'                   => 'some text',
    
'price'                         => 20,
    
'short_description'             => 'description text',
    
'weight'                        => 5,
    
'status'                        => 'Enabled',
    
'tax_class_id'                  => 'Taxable Goods',
);

$line = array (
    
'i'     => 1,
    
'row'   => $row
);

$product Mage::getModel('catalog/product');
$product->importFromTextArray($line);
$product->save();
it works fine
Any idea about how to add tier price to the product? Appreciate any help.
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top