How to change the number of columns on the product listing page?

Share
Posted on September 24th, 2014 | Posted by admin

All you need to do is open the catalog.xml file under app/design/frontend/default/YOUR THEME/layout/catalog.xml and add this piece of code

<action method="setColumnCount"><columns>2</columns></action>

under the Category Default Layout:

<!--
Category default layout
-->

inside the “product_list” block

<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">

How to get product id from the current product page

Share
Posted on May 13th, 2013 | Posted by admin

I wanted to implement a way that products images in magento could be able to have link to open a popup when the image is clicked to show a larger image in a separate browser window
for that we would need the product id to send it with the link url and receive it by get method there
I dont want to intruct the way we would show the product instead I want to show you how to get the current product id to send it with the url let say
ur/file.php?id=884

$product_id = $this->getProduct()->getId();

or if you could not able to use $this instead of the above you can use

$product_id = Mage::registry(‘current_product’)->getId();

Product Collection in Magento

Share
Posted on April 13th, 2013 | Posted by admin
we will see some important function in magento product collection class.
Product Collection class in magento is Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection. Lets look at the important functions
Get All Products of a category

$collection = Mage::getResourceModel('catalog/product_collection')

->setStoreId($this->getStoreId())
->addCategoryFilter($category);

Tn this the addCategoryFilter() function, is used to get all products of a particular category. So, if you want to get all products of a certain category use this function.
Visibility Filter

Magento: How to get all attribute codes by product object or attribute set ID

Share
Posted on April 1st, 2013 | Posted by admin

I’m writing an script for exporting Magento products to an XML file. In my PHP script, I have decided to create an class for holding the data of Magento product. In that class which defines all attributes from a product like the editing product screen from back-end

Magento: How to get all attribute codes by product object or attribute set ID

Magento Display Product SKU

Share
Posted on March 26th, 2013 | Posted by admin

If you happen to use Magento to develop your e-commerce site, and want to display SKU number on your product page, here is how you can use the magic method getSku to do it. On your app/design/frontend/default/default/template/catalog/product/view.phtml page, add in the line below:

getSku()) ?>

Page 1 of 812345»...Last »