通过sku得到产品的方法:
$product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
给产品增加相关产品的方法:
$param = array(
101=>array(
'position'=>3
),
102=>array(
'position'=>5
)
);
$_product->setRelatedLinkData($param);
//here ... some other product operations and in the end
$_product->save();
OK!