Made some changes to sql querie to make this contribution compatible with MySql 5.
This will avoid the message: 1054 unknown column 'p.manufactureres_id ' in on clause at categories with nested subcategories

Full package

More...