Home » Archive

Articles tagged with: Magento Programming

Magento Customization, Magento Guide »

[6 Oct 2009 | No Comment | ]

Due to the “complexity” of Magento’s xml files, developers can waste great amount of time on “unnecessary” things.
When I say “complexity” I say it with purpose. XML files are not so complex by them selves, but due to extreme lack of documentation and changes Magento pumps in every new “major” release, people are lost among things that should really be sideways. Anyway, in this little article I will show you how to create basic, startup structure for your module to get it shown under Magento Admin main top menu.
As you …

Magento Guide »

[6 Oct 2009 | No Comment | ]

As many things in Magento, removing product comparison is not available thru the admin interface. Thus, leaving us with the only option of getting down and dirty with theme files editing.

This guide is pretty straightforward and is based on the Magento ver. 1.3.1.1
Before beginning of this procedure please Go to: System-> Cache Management and disable cache. You can turn it on after you’re done.
Step 1 – reports.xml
Open: app/design/frontend/deafult/Your Theme name/layout/reports.xml and delete the following lines:

<block type="reports/product_compared" before="right.permanent.callout" name="right.reports.product.compared" template="reports/product_compared.phtml" />

<pre><block type="reports/product_viewed" before="right.permanent.callout" name="right.reports.product.viewed" template="reports/product_viewed.phtml" /></pre>

Step 2 – catalog.xml
Open app/design/frontend/deafult/Your …

Magento Guide »

[5 Oct 2009 | No Comment | ]

There are few different ways one can achieve this kind of functionality. Normally in Magento you would do it like a real, “independent”, module (extension) thus loosing at least two ours to make a few lines of code work.
The simplest way to add this kind of feature to your product view page is to open the view.phtml file under the app/design/frontend/default/custom/template/catalog/product/ folder.
And add the following code where you sish to show your “Tweet this” link:

<a title="Send this page to Twitter!" href="http://twitter.com/home?status=Check out the <?php echo $this->htmlEscape($_product->getName()) ?> at < ?php …

Magento Customization, Magento Guide »

[2 Oct 2009 | No Comment | ]

Magento has several issues with duplicated content. Of course, you don’t actually have two versions of the same content in your database, however, in the eyes of search engines, two different URLs serving same content are counted as duplicated content and will cause you lots of problems. The most obvious problem is that your page rank is leaking on different versions of virtually the same landing page. You also might end up with having several versions of the same content indexed which is bad in so many ways.
First duplicated content …

Magento Guide »

[2 Oct 2009 | No Comment | ]

I have been involved in Magento development for almost a year now. God knows I had (and still have) my moments of pain with it . If you are in professional, everyday, PHP development that focuses mainly on Magento then your life probably isn’t all flowers and bees. Magento is extremely rich eCommerce platform, but its main downside IMHO is its size and code complexity. If you download Magento via SVN, you will sound find out it has around 11 600 and more files. This is no small figure. …

Magento Guide »

[1 Oct 2009 | No Comment | ]

This is my first post here and I’ll write about my first challenge regarding Magento since I came to work at Inchoo.
As title says I’ll show you how to implement simple random banner rotation functionality in Magento using static blocks.
First of all, upload images you want to use in “/skin/frontend/YOUR_INTERFACE/YOUR_THEME/images/”
In admin panel add N static blocks (”CMS->Static Blocks->Add new block”)
For identifier field use something like this:

SomeBannerIdentifierName_1
SomeBannerIdentifierName_2
SomeBannerIdentifierName_3

SomeBannerIdentifierName_N

For each content use this:

<a href="ADDRESS_YOU_WANT_TO_USE"><img src="{{skin url=images/media/IMAGE_YOU_WANT_TO_USE.jpg}}" alt="Some alt text"  /></a>

Please note that you are not restricted only to images, you could use text, video …

Magento Guide »

[1 Oct 2009 | No Comment | ]

Unlike good old WordPress that “every kid in the block” knows how to create a plugin for, Magento is a whole new system. It requires extensive knowledge of OOP, ORM’s, MVC, and few other stuff. This is why not “every kid in the block” can write a module for Magento, and this is why I love it. However, unlike WordPress, Drupal and other community driven systems out there who keep in mind backward compatibility things with Magento things are a bit different.
One of the things that caught my eye and …

Magento Guide »

[30 Sep 2009 | No Comment | ]

Some of you may encountered this problem. You install new Magento extension through downloader, try to access its configuration settings and Magento throws “Access denied” page at you. Although you’re administrator of the system.

So what happened here? Magento just doesn’t have stored privileges for this new extension.
First just try to logout and login again. If that doesn’t work, you need to reset admin privileges.
Navigate to System->Permissions->Roles and click Administrators role.

Check your Role Resources settings just in case, Resource Access dropdown should be already set to All for administrators.

Without changing …

Magento Guide »

[30 Sep 2009 | One Comment | ]

I see my coworker and friend Željko Prša made a nice little post on Adding a new language in Magento so I figure I’ll jump with a little Drupal to Magento integration trick concerning link issues and multilingual sites. Here is a piece of code you can use in your Drupal templates to do the proper switching from Drupal site to Magento while keeping the selected language of site. Note, this tweak assumes you have the desired language setup on both Drupal and Magento side.
This part goes to some of …

Magento Customization »

[28 Sep 2009 | 4 Comments | ]

Hi everyone. I wrote this little plugin while working on one of our projects. If you know your way around WordPress then you know what $wpdb variable stands for. Imagine the following scenario. You have WordPress installation on one database, Magento on another. You know your way around SQL. You can always make new object based on WPDB class inside your template files giving it database access parameters, or you can use this plugin and use $MAGEDB the same way you use $wpdb.
Below is a little example of using $MAGEDB …