Home Archive

Articles in the Magento Customization Category

3 Sep 3 Sep 2009 Comments Off

Magento comes packed with a lot of options. But no matter how many options you put into some product you can never cover all of them. One of such options (for now) is a color switcher in Magento. To be more precise, an image switcher based on color selection.
Recently I’ve made a screencast on my site on this subject, with somewhat different title. The idea is to have a dropdown box from which you choose a color and based on the color selection product image changes. All of this is …

Read More

 
27 Jul 27 Jul 2009 3Comment

This is a simple magento tips but there are many people have asked for.
You can find and edit this file:
magento\app\code\core\Mage\Catalog\Model\Product\Image.php
find this code:
protected $_backgroundColor  = array(255, 255, 255); //white background
change the background to the color you prefer:

protected $_backgroundColor  = array(0, 0, 0); //black color

//protected $_backgroundColor  = array(0, 0, 255); //blue color

Clear cache and refesh the fontend to get your result.
Good work!

Read More

 
26 Jul 26 Jul 2009 Comments Off

Magento is the strongest ecommerce opensource now. Each day, there are many new Magento webiste are published. In this artilce, I please write my experiences so magento designers or magento developers can custom magento theme quickly.
The first: We need to design magento shop, normally we just need to design for 3 main pages: Home page, category page and product detail pages. The other pages will be based on default theme, modern them or blank themes, because the design of default, modern theme is very nice and very standard, so it …

Read More

 
26 Jul 26 Jul 2009 1Comment

Magento main menu is construed based on the hierarchy like,
Root Category → Category → Sub-Category
We will customise the menu to show the Products of a category/su-bcategory along with its hierarchy in dropdown menu as seen below.

This is a good feature if you have less products in a website.
In order to implement the above structure, we need to modify the navigation.php file of drawItem() function like below. The navigation.php is available in the following location,
app/code/core/Mage/Catalog/Block/Navigation.php
The code is,

<code>Public function drawItem($category, $level=0, $last=false){
$html = ”;
if (!$category->getIsActive()) {
return $html;
}
$children = $category->getChildren();
$hasChildren = $children …

Read More

 
26 Jul 26 Jul 2009 Comments Off

Just some code for custom category menu navigation. I’m a bit short on time so, no fancy walk trough. All you need to make this show on your page is to call it inside layout file like
<block type=”core/template” template=”surgeworks/customcatnav.php” />
Filename: customcatnav.php.

<?php
//Get store id
$storeId    = Mage::app()->getStore()->getId();

//Get category model
$_category = Mage::getModel(’catalog/category’)->setStoreId($storeId);

$_categoryCollection = $_category->getCollection();
$_categoryCollectionIds = $_categoryCollection->getAllIds();

//Remove root category from array
unset($_categoryCollectionIds[0], $_categoryCollectionIds[1]);

?>

<div class=”content”>
<?php

$o = null;

$o .= ‘<dl>’;
foreach ($_categoryCollectionIds as $catId)
{
$_category = $_category->load($catId);

if($_category->getLevel() == 2)
{

$catChildren = $_category->getChildren();
if(!empty($catChildren))
{
$o .= ‘<dt>’.$_category->getName().’</dt>’;

$categoryChildren = explode(”,”, $catChildren);

foreach ($categoryChildren as $categoryChildId)
{
/* @var $_childCategory Mage_Catalog_Model_Category */
$_childCategory = $_category = Mage::getModel(’catalog/category’)->setStoreId($storeId)->load($categoryChildId);

$o .= ‘<dd>’;
$o …

Read More

 
26 Jul 26 Jul 2009 2Comment

Look for the top.phtml corresponding to your menu.
You can find the top.phtml files using SSH shell with this command.
Come to the app/ folder
find -name top.phtml

./design/frontend/default/iphone/template/catalog/navigation/top.phtml
./design/frontend/default/default/template/catalog/navigation/top.phtml
./design/frontend/default/blank/template/catalog/navigation/top.phtml
./design/frontend/default/modern/template/catalog/navigation/top.phtml

From above you should be able to locate your themes top.phtml
now edit the top.phtml
nano design/frontend/default/modern/template/catalog/navigation/top.phtml

<ul id=”nav”>
<li><a href=”<?php echo $this->getUrl(”)?>”><?php echo $this->__(’Home’) ?></a></li>

<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?>

<li><a href=”<?php echo $this->getUrl(’about-magento-demo-store’)?>”><?php echo $this->__(’About Us’) ?></a></li>

</ul>

I have added two links “Home” and “About Us” in the above code (colored yellow)

Not happy with where your site shows up in the search engines? Our clients …

Read More

 
23 Jul 23 Jul 2009 2Comment

Recently, I just finished coding out a website for a client in Magento. You can view the site at www.3graces.com, it was a full switch from some old legacy asp shopping cart to Magento. Im really happy with the way things turned out and the client is too, Magento just has so many wonderful features built-in.
One feature that I found wasn’t built in was a way to display each sub-category with an image, and its name on a landing page. Magento has a nice feature which allows you to assign …

Read More

 
23 Jul 23 Jul 2009 3Comment

Here are 3 quick solutions to try if you do not see your Magento store categories after a fresh install of Magento or an upgrade to the latest version. I wanted to post this because I just recently helped install Magento for someone and experienced this. The installation version was the latest Magento version, 1.2.1.2 and product categories did not show up on the frontend after they were added in the administration interface.
The top 3 solutions to this in my experience are:

The categories not added as sub-categories of the Default, …

Read More

 
23 Jul 23 Jul 2009 Comments Off

This is quite a common want, so I thought I would put together a quick tutorial with some ideas and pointers. My main goal will be to give you a starting point for building a static block and PHTML file that can be applied to top level categories to dynamically create a block with of all the subcategories.
The first thing to do is create a new static block (CMS → Static Blocks), lets call it ‘Dynamic Landing Pages’. Within the content paste this:
{{block type=”catalog/navigation” name=”catalog.category” template=”catalog/category/list.phtml”}}
If you’ve not seen …

Read More

 
20 Jul 20 Jul 2009 6Comment

Magento Vertical Menu using Peter Hamilton’s code
In one of our premium Magento themes we implemented a vertical category menu with the code adapted from this thread. It’s quite easy to implement and to make it even easier for others, we decided to write a step by step tutorial.

Add a new block type in “catalog.xml” file
Create a new phtml file and name it “leftnav.phtml”, place it inside catalog/navigation
Edit CSS

Add a new block type in “catalog.xml” file
Here we presume you want to have the vertical category menu shows up on every page, …

Read More