0

I have special case where I need to allow to create customer groups with a name that already exists.

This is done through an import where we're able to differentiate between groups with the same name by extending table customer_group with a new column for external_id.

Does anyone know how this can be accomplished?

Many thanks!

1

It looks like the customer group name constraint is enforced on the code level and not on the DB itself. I didn't spend too much time, but looking at Mage_Core_Model_Resource_Db_Abstract, take a look at method save() which calls _checkUnique() that throws an exception for non-unique customer group name (see around line 676 on 1.9.2).

This can be overcome by using direct SQL or the Zend DB adapter, and since customer_group table is so simple, it should be easy and safe. I would use the latter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.