Skip to content

Instantly share code, notes, and snippets.

@aurire
Last active December 17, 2019 11:14
Show Gist options
  • Save aurire/cbf2512d577e8ece344c847f7c898fb6 to your computer and use it in GitHub Desktop.
Save aurire/cbf2512d577e8ece344c847f7c898fb6 to your computer and use it in GitHub Desktop.
Magento. Get Catalog Product Entity Type ID, instead of using 4 (MAGIC NUMBER). Works the same, for getting other entity type id by name.
$entityTypeId = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();
//Alternative
$entityTypeId = Mage::getSingleton('ceav/config')->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getId();
@Winfle
Copy link

Winfle commented Feb 6, 2017

Should be eav/config instead of ceav/config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment