Magento themes and extensions

3 More Magento Code Snippets

Posted on January 21st, 2013 | Posted by admin

here we are with another three Magento code snippets. This week: using your Magento classes outside a Magento file,

  1. OK, so first lets look at a code snippet which allows you to use your Magento code outside your Magento environment (i.e. outside the app folder). This is useful if you want to add a list of products to your self hosted WordPress blog for example (although I’ll be covering doing this a different way in a tutorial soon).To do this, you’ve got to add the following lines of code to the top of your php file:

Switch from Prototype to jQuery

Posted on January 20th, 2013 | Posted by admin

This would be a pretty extensive change to the code, but needed if Magento is to stay fresh. jQuery is a much more robust and easy to use framework than Prototype, not to mention that it is much more actively developed for. Community support for jQuery far outweighs support for Prototype.

How to make Magento elements show/hide on other elements’ value

Posted on January 18th, 2013 | Posted by admin
How to make Magento elements show/hide on other elements’ value
Today I noticed, when working on an admin form, that a class exists for automatically hiding elements when the value of fields change.

Useful Magento functions

Posted on January 17th, 2013 | Posted by admin

Useful Magento functions

Get the current store language code

$locale = Mage::app()->getLocale()->getLocaleCode();

Get user id of the current logged in user


Set the value ‘myValue’ to the session variable myVariable

Magento Solutions Products not showing up

Posted on January 15th, 2013 | Posted by admin

If you are working with Magento for the first time you probably found yourself asking this question: Why are my products not showing up on homepage/category page?

So I made a list of reasons or things you should consider:

1. The most simple reason – your product’s status is disabled – set status to Enabled (General tab from your product details page)

2. Visibility - your product is not set as visible in the category page set Visibility to Category or Category, Search

3. Inventory problems

- your product is not on stock go to Inventory tab from your product details page and check if Stock Availability is set On Stock

- quantity – check if  Qty from Inventory tab is greater then 0

4. Disable your cache or if it is you want it enabled refresh it from System > Cache Management

5. Reindex data from System > Index Management – Reindex Data