Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
how to add related products to a product? 
 
abosalam
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2008-04-25
 

I am trying to add products, reading from xml file and save the products to Magento database, but I could not figure out how to add related products to the product I am adding.  Any Idea about how to add related products?
this this the code

$current_Product Mage::getModel('catalog/product')
        ->
setSku($sku)
        ->
setDeliverystatus($deliverystatus)
        ->
setDeliveryStatusMessage($deliverystatusmessage)
        ->
setStatus($enabled)
        ->
setWeight($weight)
        ->
setTaxClassId('Taxable Goods')
        ->
setSoldQuantity($soldquantity)
        ->
setReleaseDate($releasedate)
        ->
setName($title)
        ->
setSubtitle($subtitle)
        ->
setPublisherId($publisherid)
        ->
setProductUrl($url)
        ->
setProductType($producttype)
        ->
setNewSku($newsku)
        ->
setPrice(15.49)
        ->
setCategoryIds($categories_array)
        ->
setAttributeSetId(4)
        ->
setStoreId(2)
        ->
setDescription($longdescription)
        ->
setShortDescription($shortdescription)
        ->
setDeliverystatusmessage($deliverystatusmessage)
        ->
setProductType($producttype)
        ->
save();

->setRelatedProductIds($related_product_array_Ids) does not work? Any idea?
Thanks

 Signature 

The Greatest of These Is Love

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53209 users|754 users currently online|107249 forum posts