Get Related Product Collection
$related_product_collection = $_product->getRelatedProductCollection();
$related_product_collection->AddStoreFilter();
foreach($related_product_collection as $pdt)
{
$pdt_id=$pdt->getId();
$model_rel = Mage::getModel('catalog/product'); //getting product model
$_product_rel = $model_rel->load($pdt_id); //getting product object for particular product id
$rel_name= $_product_rel->getName();
$rel_price= number_format($_product_rel->getPrice(),2);
$rel_img_url =
$this->helper('catalog/image')->init($_product_rel,
'image')->keepFrame(false)->resize(156,107); //Image resize code
?>
Get Upsell Product Collection
<?php
$upsell_product_collection = $_product->getUpSellProductCollection();
$upsell_product_collection->AddStoreFilter();
foreach($upsell_product_collection as $pdt)
{
$pdt_id=$pdt->getId();
$model_upsell = Mage::getModel('catalog/product');
$_product_upsell = $model_upsell->load($pdt_id);
$upsell_name= $_product_upsell->getName();
$upsell_price= number_format($_product_upsell->getPrice(),2);
$upsell_img_url =
$this->helper('catalog/image')->init($_product_upsell,
'image')->keepFrame(false)->resize(100,100);
?>
Get Cross Sell Product Collection
<?php
$crossselll_product_collection = $_product->getCrossSellProducts(); $crossselll_product_collection>AddStoreFilter();
foreach($crossselll_product_collection as $pdt)
{
$pdt_id=$pdt->getId();
$model_crosssell = Mage::getModel('catalog/product');
$_product_crosssell = $model_crosssell>load($pdt_id);
$crosssell_name= $_product_crosssell->getName();
$crosssell_price= number_format($_product_crosssell->getPrice(),2);
$crosssell_img_url =
$this->helper('catalog/image')->init($_product_crosssell,
'image')->keepFrame(false)->resize(100,100);
?>
No comments:
Post a Comment
Thanks for visit blog.