tantosoft.com

sm shopby no indexa bien tras actualizar magento a 1.9.2.x

Tras actualizar a la última versión de magento me sa errores el índice de SM Shopby, y no actualiza correctamente, se queda en error. Para corregirlo hay que editar el fichero: app/code/local/Sm/Shopby/Model/Resource/Indexer/Attribute.php en la línea 65 aprox, donde la funcion _getAttributes() y quitar las comillas a '`main_table`.`frontend_input`' y a '`main_table`.`attribute_id`' y dejarlos así:

'main_table.frontend_input' y a 'main_table.attribute_id'.

Sacado de https://community.magento.com/t5/Technical-Issues/Cannot-initialize-the-indexer-process/td-p/21640

Re: Cannot initialize the indexer process?

I ran into this exact issue as well. I narrowed it down to a problem with Attribute.php.

Open app/code/local/Sm/Shopby/Model/Resource/Indexer/Attribute.php

Around line 65 you will find the protected function called _getAttribute.

Change from this,

protectedfunction _getAttributes($attributeId =null){
        $collection =Mage::getSingleton('eav/config')
            ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
            ->getAttributeCollection()
            ->addFieldToFilter('`main_table`.`frontend_input`', array('in'=> array('select','multiselect')));
        if(!empty($attributeId)){
            $collection->addFieldToFilter('`main_table`.`attribute_id`', $attributeId);
        }

        return $collection;
    }

to this code instead,

    protectedfunction _getAttributes($attributeId =null){
        $collection =Mage::getSingleton('eav/config')
            ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
            ->getAttributeCollection()
            ->addFieldToFilter('main_table.frontend_input', array('in'=> array('select','multiselect')));
        if(!empty($attributeId)){
            $collection->addFieldToFilter('main_table.attribute_id', $attributeId);
        }

        return $collection;
    }

What changed?

The only thing I changed was removing the apostrophes (´) at lines 69 and 71. Which means that ´main_table´.´frontend_input' is now changed into main_table.frontend_input. Now the scripts updates SQL properly. Both in Admin and Shell.

 

Quiere contactar con nosotros?

Envíenos un Esta dirección de correo electrónico está siendo protegida contra los robots de spam. Necesita tener JavaScript habilitado para poder verlo. o llámenos a (+34) 698 259 856