Skip to content

Using code hints in Magento e-Commerce templates…

When you’re using a complex web application like Magento or WordPress it’s a real struggle to remember all the functions, classes and methods that are available to you in the template files. And this means endless trips back to the documentation, trial and error, and other such in-efficiences.

Fortunately you can speed things up a load by manually adding code hints for a variable, which then should bring up code completion hints in any half decent IDE like Eclipse or Netbeans.

/* @var $_product Mage_Catalog_Model_Product */
echo $_product->getData('short_description');

Of course if it’s a complex object you can end up with an enormous list of methods, then you just have to pray that someone has included decent phpdoc in the Class definition (Magento doesn’t, WordPress does).

Need some help with an e-Commerce solution? Small business looking for inexpensive e-Commerce, or design agency looking for talented freelancer in and around Bath, Bristol, Wiltshire or Somerset? Why not get in touch?

This entry was posted in Web Development and tagged , , . Bookmark the permalink.


Sorry, comments are closed on this page.