views:

659

answers:

1

I have a customer who retails third party batteries, and some batteries can replace several OEM models.

For instance, 3rd party SKU 12345 may replace Toshiba N23 and HP 53214, thus my customer would like to create two products with the same SKU in front end (they are essentially the same product). However, Magento by default does not allow duplicated SKU.

My current solution is to set SKU to not required from the backend, and add another attribute called Model that allows duplicated values, and display the Model in front end.

Is there a better way to do this? Or is it possible to allow duplicated SKU?

Tian Bo
Noble Technologies

+2  A: 

It sounds to me like you've found a good solution. I'm not so sure you should try to have duplicate values for SKU for two reasons.

First the whole point of SKU is that it is a unique identifier. That's its sole purpose in life. It has no other purpose. From a strictly architectural point of view, if you're going to have duplicate values, then it's not a unique identifier, but just another attribute. Of course Magento still needs a unique identifier to work, which means that this is an extra field, which takes us exactly where you are now.

That said we come to my second point which is this... I'm not exactly a Magento guru, but I've built my share of e-commerce sites and one thing I've learned is that they tend to depend on certain unbreakable rules (set by the original designer) to work properly. One of them is that unique identifiers are unique, both on the database and application level. As such, a large part of the website depends on this, to function correctly. Which I'm pretty sure goes for Magento too.

In other words trying to change such a basic premise in something so complicated is a sure way to slowly go insane...

Manos Dilaverakis