How to display magento custom attribute of in cart page

More often than not you would require to display the value of a custom attribute of a product at cart page. There are few ways to do so, but following snippet of code will help you to display the value quickly and in clean way:

Open

app/design/frontend/default/YOUR_TEMPLATE/template/checkout/cart/item/default.phtml and add the following code after line number 42, which is a closing </h2> tag.

<?php $_product = Mage::getSingleton(‘catalog/product’)->load($_item->getProductId()) ;
if( $_product->getResource()->getAttribute(‘your_attribute_code’)->getFrontend()->getValue($_product) ){
echo $_product->getResource()->getAttribute(‘your_attribute_code’)->getFrontend()->getValue($_product);
}
?>

Replace your_attribute_code with the actual attribute code that you have used while creating it from the back-end.

Magento custom attribute code

Magento custom attribute code

 

Placing the contact form in a static page of magento

A contact form is an effective way to interact with the your customers and get valuable feedback from them. This post will help you in understanding how the contact form can be placed in any of static page (CMS pages) of magento.

If you want to provide an option in the admin area to edit the content of the contact form with some additional data like contact address, and so on, here is how to do it…

Continue reading

Adding Google AdWords tracking code to order confirmation page in Magento

Google AdWords tracking code is an awesome way to manage and optimize advertisement campaign of your web store. And no, it is not difficult at all to integrate the tracking code with your magento based website, If you have the Google AdWords tracking code, you can easily add it to the order confirmation page by following some simple steps as below -

Continue reading