How to get default product attribute set id?

freento

I need to get default product attribute set id in helper. I can get it using

$catalogProductEntityTypeId = Mage::getModel('catalog/product')->getResource()->getTypeId();
$defaultAttributeSetId = Mage::getModel('eav/entity_attribute_set')
            ->getCollection()
            ->addFieldToFilter('attribute_set_name', 'Default')
            ->addFieldToFilter('entity_type_id', $catalogProductEntityTypeId)
            ->getFirstItem()
            ->getId();

But may be somebody know easier way with less code amount?

Jürgen Thelen

A shorter version would be this:

$sDefaultAttributeSetId = Mage::getSingleton('eav/config')
    ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
    ->getDefaultAttributeSetId();

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Get Variation ID and Attribute Value on Product page

From Dev

Magento If product has attribute, get it's ID

From Dev

Get all attributes of an attribute set that is not present in default attribute set

From Dev

Get default value if attribute not set or faulty in Javascript

From Dev

How to get ID of user set default keyboard in Android

From Dev

How to get product attribute value in magento

From Dev

How to assign attribute to the product without attribute set in magento

From Dev

How to set id attribute to table?

From Dev

How to get Product Attribute Options by attribute code in Magento 2.0

From Dev

How to set the default value of directive attribute?

From Dev

JQ Datepicker - Set Default date from Data Id Attribute

From Dev

Is it possible to get element id by attribute's value and set an attribute to the parentNode

From Dev

How to get product id on Product Editing page in BackOffice Prestashop 1.7

From Dev

How to get the terms from WooCommerce product attribute taxonomies?

From Dev

How to get meta data from WooCommerce product attribute terms

From Dev

How to get the terms from WooCommerce product attribute taxonomies?

From Dev

WooCommerce - Get custom product attribute

From Dev

Magento Get Attribute for current product

From Dev

How can I get the vendor ID and product ID for a USB device?

From Java

How to get the data-id attribute?

From Dev

Magento how to get attribute value by option id?

From Dev

Selenium c#: How to get the Id attribute?

From Dev

Magento how to get attribute value by option id?

From Dev

How to get inner html based on attribute Id

From Dev

Selenium c#: How to get the Id attribute?

From Dev

Yii2: How to set default attribute values in ActiveRecord?

From Dev

How to set a default attribute value for a Laravel / Eloquent model?

From Dev

How to set a default value for attribute if it doesn't exist in the XDocument object

From Dev

Java: how to set default value to annotation with another annotation as its attribute?

Related Related

  1. 1

    Get Variation ID and Attribute Value on Product page

  2. 2

    Magento If product has attribute, get it's ID

  3. 3

    Get all attributes of an attribute set that is not present in default attribute set

  4. 4

    Get default value if attribute not set or faulty in Javascript

  5. 5

    How to get ID of user set default keyboard in Android

  6. 6

    How to get product attribute value in magento

  7. 7

    How to assign attribute to the product without attribute set in magento

  8. 8

    How to set id attribute to table?

  9. 9

    How to get Product Attribute Options by attribute code in Magento 2.0

  10. 10

    How to set the default value of directive attribute?

  11. 11

    JQ Datepicker - Set Default date from Data Id Attribute

  12. 12

    Is it possible to get element id by attribute's value and set an attribute to the parentNode

  13. 13

    How to get product id on Product Editing page in BackOffice Prestashop 1.7

  14. 14

    How to get the terms from WooCommerce product attribute taxonomies?

  15. 15

    How to get meta data from WooCommerce product attribute terms

  16. 16

    How to get the terms from WooCommerce product attribute taxonomies?

  17. 17

    WooCommerce - Get custom product attribute

  18. 18

    Magento Get Attribute for current product

  19. 19

    How can I get the vendor ID and product ID for a USB device?

  20. 20

    How to get the data-id attribute?

  21. 21

    Magento how to get attribute value by option id?

  22. 22

    Selenium c#: How to get the Id attribute?

  23. 23

    Magento how to get attribute value by option id?

  24. 24

    How to get inner html based on attribute Id

  25. 25

    Selenium c#: How to get the Id attribute?

  26. 26

    Yii2: How to set default attribute values in ActiveRecord?

  27. 27

    How to set a default attribute value for a Laravel / Eloquent model?

  28. 28

    How to set a default value for attribute if it doesn't exist in the XDocument object

  29. 29

    Java: how to set default value to annotation with another annotation as its attribute?

HotTag

Archive