Magento Themes and Magento Extensions

Magento – Add Custom Category Attributes

Share
Posted on April 23rd, 2013 | Posted by admin

Magento – Add Custom Category Attributes

A client wanted to add a description to each of his product categories, such that the first built-in description would be above the product listing, and the second description would be below the product listing.  Rather than have them create static blocks for every category, it was obvious that I’d have to create a new category attribute.

Fortunately, I stumbled upon one possible solution.  The method doesn’t involve creating a full-blown module, rather, just a few database modifications using phpMyAdmin.

Summarized, the process comes down to:

  1. Create a new row in the eav_attribute table, one that mimics a category’s meta-description attribute with everything being the same except for a unique identifier and a label.
  2. Create a new row in the eav_entity_attribute table, to provide a sort order for your newly created attribute, following in the format footsteps of the existing rows.

Create a custom category attribute in Magento

Share
Posted on April 4th, 2013 | Posted by admin

Create a custom category attribute in Magento
Copy and paste the following code in your header.phtml

Magento Custom Category Listing Block

Share
Posted on April 3rd, 2013 | Posted by admin

Here I wanted to show you how to build a custom Magento category listing block that you can use on your own Magento store. We will go over each step at getting a category listing of your magneto categories and even a sub category listing.

Here is the finished code for your new category listing block.

<?php
$cats = Mage::getModel('catalog/category')->load(2)->getChildren();
$catIds = explode(',',$cats);
?>
<ul>
<?php foreach($catIds as $catId): ?>
	<li>
    	<?php
			$category = Mage::getModel('catalog/category')->load($catId);
			echo $category->getName();

Show category block on a magento page via cms

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

Show category block on a magento page via cms

Add this snipp to any page’s body in the cms to show a category’s items on that page. “category_id” being the id of the category, duyee.

{{block type=”catalog/product_list” category_id=”4″template=”catalog/product/list.phtml”}}

Change magento column count in products grid list for each category

Share
Posted on January 21st, 2013 | Posted by admin

Change magento column count in products grid list for each category

Add the following code into “Custom Layout Update” field for the category that you want change the number of products for each row to be diaplyed

<reference name=”product_list”>
<action method=”setColumnCount”><count>4</count></action>
</reference>

Refresh the cache and try out

Page 1 of 41234»