Browsed by
Month: May 2017

Magento How To Add New Product

Magento How To Add New Product

Magento how to add new product

Today we will discuss how to add new product.

There are three way to add new products list in magento.

First thing you can add new product block in phtml file, below is code.

<?php echo $this->getLayout()->createBlock(‘catalog/product_widget_new’)->setProductsCount(‘4’)->setDisplayType(‘all_products’)->setTemplate(‘catalog/product/widget/new/content/new_grid.phtml ‘)->toHtml();?>

You can add new products in cms page and cms block, bellow is code.

{{widget type=’catalog/product_widget_new’ display_type=’all_products’ products_count=’4′ template=’catalog/product/widget/new/content/new_grid.phtml’}}

you can also add neew products block in layout. For example- add new products block in home page.

<cms_index_index>

<reference name=”content”>

<block type=”catalog/product_widget_new” display_type=”all_products” products_count=”4″ template=”catalog/product/widget/new/content/new_grid.phtml”/>

</reference>

</cms_index_index>

Magento How To Check Is Home Page In phtml File

Magento How To Check Is Home Page In phtml File

Magento how to check is home page in phtml file.

Today we will discuss how to check is home page  in phtml file.

First Need to open  template file .

<?php if(Mage::getSingleton(‘cms/page’)->getIdentifier() == ‘home’ &&
Mage::app()->getFrontController()->getRequest()->getRouteName() == ‘cms’) : ?>

// your home page content is here.

<?php endif; ?>

thanks

Magento How to get dropdown attribute value in product page

Magento How to get dropdown attribute value in product page

Magento How to get dropdown attribute value in product page.

Today we will discuss how to add drop-down attribute on product Page.

First Need to open file in below directory or folder path.

app/design/frontend/your_theme_name/default/template/catalog/product/view.phtml

<?php echo $_product->getAttributeText(‘attribute_code_here’);?>

Thanks