Magento custom designed gallery

Share
Posted on March 23rd, 2011 | Posted by admin

Magento custom designed gallery plugin contains two modules.
You can guess, one is for displaying images on frontend and second one is for handling images and categories in backend.

I will not write too much about this modules because there are too much files and it will take too much time to describe.
Most of things used in this modules are already described by my working colleagues.

Backend module is based on interface for adding images of products in magento shop.
When you integrate it into your shop it will install two additional custom tables in database which will store data of your gallery (categories and images)

Change any page title in Magento

Share
Posted on March 23rd, 2011 | Posted by admin

Here’s a quicky one :) How do you change page title of every Magento page if some titles are hardcoded into controller?

Since some controllers in Magento likes to force page titles like

1
2
3
4
$this->loadLayout();
...
$this->getLayout()->getBlock('head')->setTitle($this->__('My Account'));
$this->renderLayout();

we can’t go with setTitle through layout, since controller is setting title right before rendering.

There is a simple solution for this, use another variable for title display :)

In page/html/head.phtml template replace default

1
<title>< ?php echo $this->getTitle() ?></title>

with

1
2
3
<title>
< ?php echo ($this->getForcedTitle()) ? Mage::getStoreConfig('design/head/title_prefix').' '.$this->getForcedTitle().' '.Mage::getStoreConfig('design/head/title_suffix') : $this->getTitle() ?>
</title>

or if you don’t wish to use title prefix/sufix added from Magento admin, simply with

1
2
3
<title>
< ?php echo ($this->getForcedTitle()) ? $this->getForcedTitle() : $this->getTitle() ?>
</title>

and now just set “forced” title for pages through layout files

Magento Navigation, how to customize very helpful information?

Share
Posted on March 23rd, 2011 | Posted by admin

This post describes how Magento navigation works. I hope it will help you.
The begining of all is in template file: “category/navigation/top.phtml”

1
2
3
4
5
6
7
8
<ul id="nav">
< ?php
foreach ($this->getStoreCategories() as $_category): ?>
< ?php
echo $this->drawItem($_category);
?>
< ?php endforeach ?>
</ul>

There we call the method from class Mage_Catalog_Block_Navigation $this->getStoreCategories(). This method returns the array $_nodes from object Varien_Data_Tree_Node_Collection.

This array contains objects of Varien_Data_Tree_Node.
Every node is object of Varien_Data_Tree_Node and it is extension from Varien_Object.

Using Magento’s Import/Export Profiles

Share
Posted on March 22nd, 2011 | Posted by admin

lthough it is fairly simple to do, many Magento users offer encounter difficulties when attempting to use the import functionality built in to Magento. We see a fair number of inquiries about this here at the Magento Enterprise Support Desk, so we’ve decided to write a little tutorial to help you better understand and use Magento’s Import Profile.

First, let’s take a look at how to create an import file, which will include all the data we want to bring into Magento. To get the correct fields and values, we recommend exporting a product, i.e. a simple product or configurable product, through the Admin. This is done through ‘System -> Import/Export -> Profiles’.

In the out-of-the-box Magento configuration, there are a couple of default “Export profiles” that you may use depending on which data you would like to export.  This depends on the data which you wish to export, and there are options for customers, products, stock, etc.  Running the profile will open a new window or tab which will show the progress of the export profile, as you can see in the example below:

Tutorial: Creating a Magento Widget – Part 1

Share
Posted on March 22nd, 2011 | Posted by admin

Introduction

The Magento Community Edition Version 1.4 facilitates the use of custom frontend extensions by introducing a new concept of customizable widgets, which can provide more control over the frontend behavior and visual block placement to store owners.

Developing a widget doesn’t differ much from developing a regular Magento extension which provides some frontend functionality. Each Magento extension can have any number of widgets. You can also develop extensions which add configuration options and placement control to the functionality which already exists in other extensions.

Widget Basics

We’ll start by creating a sample module which provides 3 simple widgets. Every widget outputs a link to a corresponding bookmarking service or a social network on the page.

Create an empty module

To start a new Magento module, you have to create a module code folder under an appropriate code pool (we’re going to use local code pool for our samples here). The folder should contain a module configuration file called config.xml and a default module helper. You should also add a small “enabler” file under the app/etc/modules folder, which lets Magento know that the new module is available and resides in the specific code pool.