Archive

Archive for the ‘Magento’ Category

Utilize FireBug (and FirePHP) to speed up Magento development

January 4th, 2009

Upsss… it’s 1 hour after midnight, still not sleeping. Hopefully I’ll manage to wake up in the morning, since I’m working. Anyhow… here’s a little something I made for you guys (for those who find it useful).

I was playing around with Zend Framework today, checking out available classes and methods. My eyes filled with yoj when I came across Zend_Wildfire_Plugin_FirePhp class. It’s located under /Zend/Wildfire/Plugin/FirePhp.php folder in ZendFramework. It’s around 600 hundred lines or so. What’s cool about this class is that it has this cool method you can use to shoot out messages to FireBug. If my info is correct, this class is added to ZendFramework from version 1.6. As of time of this writing, latest version of Magento is 1.2.0.1 and it comes packed with ZendFramework 1.7.2 which is also the latest version as of time of this writing. So, there you go, bingo. We now have this cool little class that can save as a bunch of time (or not). Read more…

Interesting? Share it!
  • Digg
  • del.icio.us
  • Google
  • Technorati
  • Facebook
  • TwitThis
  • description

Magento, PHP, ZendFramework , , ,

Code completion on Magento’s $this object in ZendStudio

January 3rd, 2009

One of the issues with Magento is figuring out what method object has. Sure you can use something like

echo ‘<pre>’;
print_r(get_class_methods(get_class($this)));
echo ‘</pre>’;

to get the list of available methods. But is there an easier and most important, faster way to list methods and other relevant object class stuff? If, ba default, you write “$this->” then press “Ctrl + Space” in ZendStudio or NetBeans6.5 you would get… nothing. Both of these IDE’s cannot recognize the object context.

If you are using ZendStudio there is a cool trick you can do in order to enable code completion upon $this object inside your template.phtml files.

zendstudio-variableobjectcontext-autocompletemethodnames

All you need to do is to write something like

/* @var $this Companyname_Modulename_Block_Myentity */

Now if you were to write something like “$this->” and press “Ctrl + Space” you would see Code Assistant showing you the list of available methods. What’s cool is that it also shows you the list of inherited methods.

This approach however does not work for NetBeans.

Interesting? Share it!
  • Digg
  • del.icio.us
  • Google
  • Technorati
  • Facebook
  • TwitThis
  • description

Magento

Duplicated modules in Magento?

January 2nd, 2009

Well, I just lost half of hour trying to find the reason why my module gets duplicated on one of my pages. I was preparing some materials for a seminar I’m holding few days from now, when I got lost trying to solve the issue of my module being duplicated on one of pages I assigned it to.

Just in case some of you got into the same situation, let me save you some trouble. Golden rule, do not forget to assign a name to a module. Will save you some headache.

I provided my screen shot below for you to see what I’m talking about.

module1

Interesting? Share it!
  • Digg
  • del.icio.us
  • Google
  • Technorati
  • Facebook
  • TwitThis
  • description

Magento ,

Magento 1.2.0 out (found a little bug)

December 30th, 2008

Well, Magento 1.2.0 is out. Just downloaded it, installed and found a little bug :) If you go to product view page and look under Additional information section you will see raw HTML outputted to the screen. That is if you have assigned any of the additional information to the product you are viewing.

I provided two of the screenshots for you to see what am I talking about.

m120 m120b

And here is one way how you can fix this.

Open the following file
/app/code/core/Mage/Catalog/Block/Product/View/Attributes.php

Now on line 71 you will see the following code
$value = $this->htmlEscape($value);

Just replace it with
$value = $value;

My first impression on new Magento? Behaves faster… not sure, time will show :)

Interesting? Share it!
  • Digg
  • del.icio.us
  • Google
  • Technorati
  • Facebook
  • TwitThis
  • description

Magento

Yet another article on listing products on sale in Magento

December 25th, 2008

For those interested, I wrote an article on listing items on sale in Magento. I already wrote somewhat similar article before, however this one is far more useful and flexible. You can read it at Inchoo.net or access it via direct link.

Interesting? Share it!
  • Digg
  • del.icio.us
  • Google
  • Technorati
  • Facebook
  • TwitThis
  • description

Magento