Sort products by 2 attributes in magento catal

On my magento site we have the requirement to sort the product listings by 2 attributes, ‘Manufacturer’, ‘Name’ and then falling back to the Unique and default attribute ‘Entity ID’.

Seems magento only lets you order by 1 then entity_id. I dont mind having to do this in a hacky way if required.

Looking around a few people have the problem but no one seems to offer an answer so thought I’d give this ago ( First question too, had to be a toughie 🙂 ).

is there a reason why Magento shouldn't support uninstall/downgrade for modules

Automated instant rollback is an important feature of enterprise-grade deployment mechanisms. Currently, it’s not possible to achieve this using Magento’s built-in installation tools.

Given that Magento’s core_resource mechanism allows for the sequential execution of setup scripts for installation or upgrade of modules (via execution of SQL and also PHP), it seems logical IMHO that it should support the same process in reverse.

Now, some obvious reasons not to support it:

  1. It would be challenging for the rollback scripts to be independent (and possibly idempotent?). I don’t see this to be a valid reason to avoid the feature, it’s an excuse at best.

  2. Other modules might have dependencies on the installed module. The module’s xml declaration <depends/> node could be used to flag these linkages.

  3. A developer might want to temporarily disable a module without doing a full uninstall. This could require a new status in the xml declaration <active/> node.

Interested in your thoughts.

Dynamic Magento Grid built with database query

This is my first time asking a question here so, be nice;p .. I’m working with Magento (and Zend Framework) for the first time and I’m trying to build a custom grid that will populate based off of a manually written query. I’m trying to extend the Mage_Core_Model_Mysql4_Collection_Abstract to allow a query to be loaded into it and then parse the select fields in the extended Grid class to make it dynamic… Is this even possible or am I beating a dead horse? I’ve been at it for a week now and I’m not getting anywhere. The problem seems to be that inside the __Model_mysql4_Collection class has to be initialized with a resource model using _init() in the constuct

Magento :: Categories and Subcategories

Please anyone can help me how to design category and subcategory listing as below

PS:: Magento default design is when you click a category it will list all products in that category straight. What I really want to do is , it should list all the subcategories first in the page like the above sample site and then list all relevent products of that subcategories

I will greatly appreciate if some one can help me.

Magento modify/add columns to model resource

I have a module whose flat table I may need to add columns to and remove columns from. I know this can be done in setup, but I have to import data into the table nightly from a web service. The web service may occasionally change their column names.

First of all, does anyone know how to alter table structure in Magento without using raw SQL? Second, does anyone know the best way to do this?

I haven’t yet mastered the EAV data pattern used in Magento but would someday like to learn. Any help appreciated.

GetModel class with Magento retrieve data based on a mysql field which is not a primary key

I would like to change this snippet to fetch some data from a table, and instead of triggering the primary key(which looks like the default behaviour of the load() function), I would like to trigger another field in my request…How can i do that ?

$mytable = Mage::getModel('mytable/mytable')->load($mytable_id)->getData();


Magento — “SQLSTATE[23000]: Integrity constraint violation..” on customer update

After migrating servers, I’m getting an error every time I try to update customer information. I’m using a customer activation plugin, but after disabling it, I still get the same error.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '7-127' for key 2

What is wrong?

Even after uninstalling the plugin, I get this error while trying to save customer information. So this leads me to believe its a bigger problem with Magento and/or the server I’m switched to.

I checked the Magento’s log and I’m getting this Notice multiple times:

ERR (3): User Notice: Sorry, your PCRE extension does not support UTF8 which is needed for the I18N core  in ../httpdocs/store/lib/Zend/Locale/Format.php on line 769

Is this relevant?

how to add attributes to a category in magento with sql?

How can i add a attribute to a category in magento ?

I have read some tutorials and they said just insert two records but that doesn’t work
Already changed a lot and playing with the values but still no result

After each change i have cleared the cache so that is nog the problem

I am working with magento 1.5 and flat tables

inserted the next querys and testing with the values

INSERT INTO `eav_attribute` 


INSERT INTO `eav_entity_attribute` 

Anyone a idea ?

Thanks in advance