cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Error while implementing Best selling product feature

Getting Error while implementing Best selling product feature

I am currently using magento 1.9.2.1. I wanted to add a block of best selling product in the home page. I have tried many extensions for it and they have installed perfectly fine but when i tried adding block to my page then each time i got the following errors :

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'order_items.entity_id' in 'on clause', query was: SELECT count(DISTINCT e.entity_id) FROM `sales_flat_order_item` AS `order_items`
INNER JOIN `sales_flat_order` AS `order` ON `order`.entity_id = order_items.order_id AND `order`.state <> 'canceled'
LEFT JOIN `catalog_product_entity` AS `e` ON (e.type_id NOT IN ('grouped', 'configurable', 'bundle')) AND e.entity_id = order_items.product_id AND e.entity_type_id = 4
INNER JOIN `catalog_product_flat_1` AS `e2` ON e2.entity_id = e.entity_id
INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '2'
LEFT JOIN `catalog_product_entity_text` AS `_cp_def` ON _cp_def.entity_id = order_items.entity_id AND _cp_def.attribute_id = 135 AND _cp_def.store_id = 0
LEFT JOIN `catalog_product_entity_text` AS `_catalogpermissions_store` ON _catalogpermissions_store.entity_id = order_items.entity_id AND _catalogpermissions_store.attribute_id = 135 AND _catalogpermissions_store.store_id = 1 WHERE (parent_item_id IS NULL) AND (IF(_catalogpermissions_store.value_id > 0, _catalogpermissions_store.value, _cp_def.value) NOT REGEXP '(^|,)-1(,|$)' OR (_catalogpermissions_store.value IS NULL AND _cp_def.value IS NULL))' in /var/www/html/magento/lib/Zend/Db/Statement/Pdo.php:235
Stack trace:
#0 /var/www/html/magento/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/magento/app/code/core/Zend/Db/Statement.php(311): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/html/magento/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/html/magento/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT count(DI...', Array)
#4 /var/www/html/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT count(DI...', Array)
#5 /var/www/html/magento/lib/Zend/Db/Adapter/Abstract.php(828): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /var/www/html/magento/lib/Varien/Data/Collection/Db.php(225): Zend_Db_Adapter_Abstract->fetchOne(Object(Varien_Db_Select), Array)
#7 /var/www/html/magento/app/design/frontend/ultimo/default/template/catalog/product/bestseller.phtml(14): Varien_Data_Collection_Db->getSize()
#8 /var/www/html/magento/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/html/m...')
#9 /var/www/html/magento/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/ultimo...')
#10 /var/www/html/magento/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#11 /var/www/html/magento/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#12 /var/www/html/magento/app/code/core/Mage/Core/Model/Email/Template/Filter.php(196): Mage_Core_Block_Abstract->toHtml()
#13 [internal function]: Mage_Core_Model_Email_Template_Filter->blockDirective(Array)
#14 /var/www/html/magento/lib/Varien/Filter/Template.php(163): call_user_func(Array, Array)
#15 /var/www/html/magento/app/code/core/Mage/Core/Model/Email/Template/Filter.php(548): Varien_Filter_Template->filter('<div class="gri...')
#16 /var/www/html/magento/app/code/core/Mage/Cms/Block/Block.php(69): Mage_Core_Model_Email_Template_Filter->filter('<div class="gri...')
#17 /var/www/html/magento/app/code/local/Mirasvit/SeoAutolink/Block/Cms/Block.php(34): Mage_Cms_Block_Block->_toHtml()
#18 /var/www/html/magento/app/code/core/Mage/Core/Block/Abstract.php(919): Mirasvit_SeoAutolink_Block_Cms_Block->_toHtml()
#19 /var/www/html/magento/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#20 /var/www/html/magento/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#21 /var/www/html/magento/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#22 /var/www/html/magento/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#23 /var/www/html/magento/app/design/frontend/ultimo/default/template/page/1column.phtml(34): Mage_Core_Block_Abstract->getChildHtml('content')
#24 /var/www/html/magento/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/html/m...')
#25 /var/www/html/magento/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/ultimo...')
#26 /var/www/html/magento/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#27 /var/www/html/magento/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#28 /var/www/html/magento/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#29 /var/www/html/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#30 /var/www/html/magento/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#31 /var/www/html/magento/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(JR_CleverCms_Cms_IndexController), '27')
#32 /var/www/html/magento/.modman/JR_CleverCms/app/code/community/JR/CleverCms/Helper/Cms/Page.php(13): Mage_Cms_Helper_Page->renderPage(Object(JR_CleverCms_Cms_IndexController), '27')
#33 /var/www/html/magento/.modman/JR_CleverCms/app/code/community/JR/CleverCms/controllers/Cms/IndexController.php(20): JR_CleverCms_Helper_Cms_Page->renderPage(Object(JR_CleverCms_Cms_IndexController), '27')
#34 /var/www/html/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(418): JR_CleverCms_Cms_IndexController->indexAction()
#35 /var/www/html/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#36 /var/www/html/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#37 /var/www/html/magento/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#38 /var/www/html/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#39 /var/www/html/magento/index.php(82): Mage::run('', 'store')
#40 {main}

1 REPLY 1

Re: Getting Error while implementing Best selling product feature

Did you every figure this out? I seem to be having the same issue except it was working originally and now is not.