I’ll be short on this one. For those of you in Magento theme developement, if you ever see this message

Warning: SimpleXMLElement::addAttribute() [simplexmlelement.addattribute]: Attribute already exists

Most likely you have layout problem. So dive into your theme /layout folder and quick check to see if it relly is the messed up layout in your theme is to rename entire /layout folder to something like /_layout. This way Magento will propagate to using default theme /layout folder. If the refresehed page now works, you located the error to be in /layout folder. Now do the same for few of the files inside the layout folder.

In my example I have added the following into catalog.xml under section

<remove name=”tags_popular” />

And that caused my Customer page to be broken after customer logs in.

Hope this help someone.

 

Here is a little something to use on template/catalog/product/view.phtml page. I got few inquiries on how to get the “in_stock” status of a product. Here is a working sample code that shows different messages when and if the product is in stock or out of stock. Read the rest of this entry »

 

Company I work for does Magento. And we are good at it :) At least we think so. Our client often want Wordpress and Magento integration. This “integration” should be taken with more loosely terms in mind. Not gonna go in details of what I think by that.

Anyhow… One of the things we often do at client request is special Search functionality. Special in terms, choose to search from Articles (Wordpress) or Products (Magento). As you can see on the image below.

In order to avoid repaeating some code from Wordpress header file to Magetno header file I wrote a small class. Read the rest of this entry »

NetBeans code templates

November 21st, 2008
 

I am so excited about new NetBeans 6.5. It’s definitely my number one choice when it comes to PHP development. Today I got carried around in playing with Code templates (Tools > Options > Editor > Code Templates). This is personal favorite of mine in NetBeans. If you are like me and you do a lot of Magento developement then you are most likely to use a lot of inline code. I also use a lot of

<?php echo ‘<pre>’; print_r($variable); echo ‘</pre>’; ?>
and
<?php echo ‘<pre>’; Zend_Debug::dump($$${variable}); echo ‘</pre>’; ?>

With code templates you can add a new template. If you add a new template with abbreviation “de” and add a content like

echo ‘<pre>’; print_r($$${variable}); echo ‘</pre>’; ?>

Then all you need to do while writting code is something like

<?php de+TAB

and you get

<?php echo ‘<pre>’; print_r($variable); echo ‘</pre>’; ?>

For me this is a huge time save. I use a lot of these during development.

This is my favorite

<?php echo ‘<pre>’; print_r($variable); echo ‘</pre>’; die; ?>

Bellow you can see a screenshot of NetBeans code templates.

NetBeans code templates

NetBeans code templates

I’m loving it :)

Finally, its here, NetBeans 6.5

November 20th, 2008
 

Finally, NetBeans 6.5 has been released. My favorite PHP, XHTML and JavaScript development environment. In my personal opinion, this is one of the best IDE solutions for the previously mentioned development environments you can get. I can already hear some of you saying this is not so… anyhow… I like it :)

Download NetBeans.