M1 How do I change a magento product attribute to type static (barcode)?

I am trying to change the product attribute barcode (EAN) from a normal attribute value to a static type so it is in catalog_product_entity.

Maybe 2 questions

  1. How can I change the type easily to static? (or create it as new varchar 13)
  2. And do it so that I loose no data? (move it from old eav tables to static table in catalog_product_entity)

Tips, hints are welcome.

  • can i ask why you would want that? If it's for optimization of queries and stuff, I think you could achieve the desired result by enabling flat catalogs – simonthesorcerer Jun 18 '17 at 13:07
  • Yeah? To be honest I realized how often we use EAN for product actions (even more than SKU). But we cant just get rid of SKU ... (otherwise we could swap SKU and EAN values and use EAN (via SKU field)) .... for instance we run a stock update script. It has ean:qty fields ... and is now a lot slower than sku;qty probably because the ean:qty needs to load the product first before it can update attributes ... this is 1 reason .... – snh_nl Jun 18 '17 at 13:35
  • In short. We use ean same as sku as unique product identifier. So I thought should follow same logic. Also there is a 1:1 relation where for EAV this is not a guarantee. Interested in your views. – snh_nl Jun 18 '17 at 18:06

Your Answer

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

Browse other questions tagged or ask your own question.