Magento 1: Attention! Keep All of Your Select Attributes as INT

Yes, You heard it right. It is better to be keep all backend types of your select attributes in INT type. This is so important because that will avoid lot of headaches in future. If you want to know more details, please keep on reading.

Possible Issues if we keep select attributes backend type other than INT

  • Suppose you have a select attribute which backend type is varchar. Everything is fine. You can assign this attribute to an attribute set and all products are saving all it’s values as we need. Now you came to a situation in which you want to update this attribute via backend. Of course, you can do this via admin side, Catalog > Attributes > Manage Attributes > [Select Your Attribute] > [Do all changes] > SAVE. Bingo attribute is updated, but if you check your database an important hack is done without your knowledge which is backend type of your attribute is now INT and not VARCHAR. This is definitely going to make problems in future.

Why Magento changes backend type of attribute while save via backend. I really don’t know and I feel it’s as serious bug.

  • Suppose you have a configurable product attribute which backend type is varchar. You did a massive product import to your system. Now configurable product won’t show in category and even in search page. There is no problem with other simple products which uses same attribute, but configurable product won’t show in the assigned category pages. I don’t know the real reason behind this. But most probably this is an indexing issue. Instead if all of your configurable attributes are using backend type as INT, then there is no problem at all.

Solution For this Problem

Please keep all of your select attributes backend model as INT. I am sure you will thank me for this tip later 🙂

Rajeev K Tomy

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top