0
votes

I am doing a magento customization site ,I need to add some additional information about the product to cart page, checkout page . I am new to magento please help how can i do this.

I tried this code in app\design\frontend\base\default\template\checkout\cart\item\default.phtml

$_product =$_item->getProductId();
 $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct()
?>
<?php if($_additional = $this->getAdditionalData()): ?>

    <div class="availability in-stock"><b>Compatible with : </b><div class="button2" style="color:#77C25A;"><?php  echo $_additional['computer_manufacturers']['value']; echo " | "; echo $_additional['model_type']['value']; echo " | "; echo $_additional['model_version']['value'] ;  ?>  </div></div>


<?php endif;?>
1

1 Answers

0
votes

Hi you can try the following:

$product = Mage::getModel("Catalog/Product")->load($_item->getProduct()->getId()); 
//echo sprintf("<pre>%s</pre>",print_r($product->getData(),true));
echo $product->getColor(); //shows the key 3
echo $product->getData('color'); //shows the key 3
echo $product->getAttributeText('color'); //shows the text blue

Make the attributes available in frontend:

On manage attribute page:

  • Allow HTML Tags on Frontend
  • Visible on Product View Page on Front-end

Remove the comment on the sprintf to see thats in there. When you have a _ in the key you should use CamelCase notation so the_color will become getTheColor().

Hope it helps !