Tuesday 23 December 2014

Get cross sell products on product page magento


Get cross sell products on product page magento

Write below code in view.phtml file.
<?php
$crosssell = $_product->getCrossSellProducts();
if(count($crosssell) > 0){
    foreach($crosssell as $_crosssell)
    {
        $productId = $_crosssell->getId();
        $crossModel = Mage::getModel('catalog/product')->load($productId);
        $pName = $crossModel->getName();
        $price = $this->getPriceHtml($crossModel, true, '-crosssell');
        $crosssellImg = $this->helper('catalog/image')->init($crossModel, 'image')->keepFrame(false)->resize(400,600);
    }
}      
?>

1 comment:

Anonymous said...

Afteг going over a handful of the blog posts on your blog, I rеаlly like your technique of writіng а blοg.
I adԁed it to my boοkmаrk site list
and will be сheckіng back soon. Take а loοk at mу website
too anԁ tell me how you feel.

My webpage ... social login extension for magento