For an attribute set up as a dropdown, is that supposed to be an int
or a varchar
?
I'm fixing a catalog of products that someone else imported, and I'm seeing a size attribute set up as a dropdown as an int
type (backend
column in eav_attributes
), but the integer values are stored in the catalog_product_entity_varchar
table. So, the simple products think they have no sizes assigned.
Furthermore, I thought if the varchar EAV table had dropdown values, it stored it as a string, not an integer that points to the EAV table. I've seen a dropdown attribute stored its values in the ..._varchar
table as actual strings values and not a number that refered back to the eav attriute table because it was created as a varchar
during an extension installation.
So, my questions are..
A dropdown attribute gets a backend type of
int
if created in the admin, but if you create an attribute via an extension, you can install this column as avarchar
. Does it really matter if a dropdown attribute is anint
or avarchar
type?Regarding the catalog that I'm fixing, I'm not quite sure what the original developer did. He didn't use a text file to import the products; from the scripts I have that were used in the product import, he programmatically saved the products with data he had (i.e. via
$product->save()
). But how did this dropdown attribute get created as anint
backend but ended up in thecatalog_product_entity_varchar
table with numerical strings that point toeav_attribute_option
. I did verified these "varchar" values point to actual entries ineav_attribute_option
.IF the dropdown attribute was setup as a
varchar
backend type, how does Magento know to refer to the EAV options with the numerical varchar values instead of just assigning the attribute value as "1" or "2" (as in size 1, 2, etc. instead of Small, Medium, etc.)? I'm assuming this is because it was set up as a dropdown, but just wanted to check.