magento create tier prices programmatically

Here a simple script to create tier prices programmatically

$product = Mage::getModel('catalog/product')->load(904);
$product->setPrice($tarif->getPrix());
    
$tier_price = array();
foreach($tarif->getQtyDetails() as $detail)
{
   $tier_price[] = array(
     'cust_group'    => 32000,
     'website_id'    => 0,
     'all_groups'    => 1,
     'price_qty'     => $detail->getMin(),
     'price'         => $detail->getPrix(),
     'website_price' => $detail->getPrix(),
  );
}
$product->setTierPrice($tier_price);

Leave a Reply