Skip to main content
added 1041 characters in body
Source Link
public function __construct($attrCode)
{   
    $attrData = array(
            'group'             => '',
        --> 'type'              => 'int',
            'backend'           => '',
            'frontend'          => '',
            'label'             => ucfirst($attrCode),
            'input'             => 'select',
            'class'             => '',
            'source'            => '',
            'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
            'visible'           => true,
            'required'          => false,
            'user_defined'      => true,
            'default'           => '0',
            'searchable'        => false,
            'filterable'        => false,
            'comparable'        => false,
            'visible_on_front'  => false,
            'is_configurable'   => true,
            'unique'            => false,
        );
        $installer = new Mage_Eav_Model_Entity_Setup('core_setup');
        $installer->startSetup();
        $installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode$attrCode, $attributeData); 
$installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY,        $this->attrCode, 'backend_type','int'>addAttributeToDefaultSet();
        $installer->endSetup();
}

Where in the indicated line 4 the attribute's backend_type is set to int. After this, the configurable product is now being correctly displayed in category and search :)

$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, $attributeData);
$installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, 'backend_type','int');
$installer->endSetup();

Where in line 4 the attribute's backend_type is set to int. After this, the configurable product is now being correctly displayed in category and search :)

public function __construct($attrCode)
{   
    $attrData = array(
            'group'             => '',
        --> 'type'              => 'int',
            'backend'           => '',
            'frontend'          => '',
            'label'             => ucfirst($attrCode),
            'input'             => 'select',
            'class'             => '',
            'source'            => '',
            'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
            'visible'           => true,
            'required'          => false,
            'user_defined'      => true,
            'default'           => '0',
            'searchable'        => false,
            'filterable'        => false,
            'comparable'        => false,
            'visible_on_front'  => false,
            'is_configurable'   => true,
            'unique'            => false,
        );
        $installer = new Mage_Eav_Model_Entity_Setup('core_setup');
        $installer->startSetup();
        $installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, $attrCode, $attributeData); 
        $this->addAttributeToDefaultSet();
        $installer->endSetup();
}

Where in the indicated line the attribute's backend_type is set to int. After this, the configurable product is now being correctly displayed in category and search :)

deleted 4 characters in body
Source Link

I was able to debug the problem and discover that the configurable product wasn't being displayed because it's entity_id wasn't being added to the table catalog_product_index_price. This problem seems to be caused because the attribute used in the configurable product's creation had the backend_type set to varchar, instead int (Reference).

So I changed my code for attribute's creation to:

$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, $attributeData);
$installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, 'backend_type','int');
$installer->endSetup();

Where in the line 4 the attribute's backend_type is set to int. After this, the configurable product is now being correctly displayed in category and search :)

I was able to debug the problem and discover that the configurable product wasn't being displayed because it's entity_id wasn't being added to the table catalog_product_index_price. This problem seems to be caused because the attribute used in the configurable product's creation had the backend_type set to varchar, instead int (Reference).

So I changed my code for attribute's creation to:

$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, $attributeData);
$installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, 'backend_type','int');
$installer->endSetup();

Where in the line 4 the attribute's backend_type is set to int. After this, the configurable product is now being correctly displayed in category and search :)

I was able to debug the problem and discover that the configurable product wasn't being displayed because it's entity_id wasn't being added to the table catalog_product_index_price. This problem seems to be caused because the attribute used in the configurable product's creation had the backend_type set to varchar, instead int (Reference).

So I changed my code for attribute's creation to:

$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, $attributeData);
$installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, 'backend_type','int');
$installer->endSetup();

Where in line 4 the attribute's backend_type is set to int. After this, the configurable product is now being correctly displayed in category and search :)

Source Link

I was able to debug the problem and discover that the configurable product wasn't being displayed because it's entity_id wasn't being added to the table catalog_product_index_price. This problem seems to be caused because the attribute used in the configurable product's creation had the backend_type set to varchar, instead int (Reference).

So I changed my code for attribute's creation to:

$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, $attributeData);
$installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, $this->attrCode, 'backend_type','int');
$installer->endSetup();

Where in the line 4 the attribute's backend_type is set to int. After this, the configurable product is now being correctly displayed in category and search :)