3

This is the error, can anyone help me with a solution to this?

There has been an error processing your request

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'f4p_sales_bestsellers_aggregated_yearly.product_type_id' in 'field list', 

Query was:

SELECT COUNT(*) FROM (SELECT MAX(DATE_FORMAT(period, '%Y-%m-%d')) AS `period`, SUM(qty_ordered) AS `qty_ordered`, `f4p_sales_bestsellers_aggregated_yearly`.`product_id`, MAX(product_name) AS `product_name`, MAX(product_price) AS `product_price`, `f4p_sales_bestsellers_aggregated_yearly`.`product_type_id` FROM `f4p_sales_bestsellers_aggregated_yearly` WHERE (EXISTS (SELECT 1 FROM `f4p_catalog_product_entity` AS `existed_products` WHERE (f4p_sales_bestsellers_aggregated_yearly.product_id = existed_products.entity_id))) AND (store_id IN(0)) GROUP BY `product_id` LIMIT 5) AS `t`
6

Check this table f4p_sales_bestsellers_aggregated_yearly have 'product_type_id' columns in it.

If 'product_type_id' column is in table then re-index and refresh cache.

If 'product_type_id' column is not in table then you need to create (upload backup table) table again.

2

Database should look like this. Database correct view

0

This happens if product_type_id was not added by setup update script app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.9-1.6.0.10.php:

$installer->startSetup();

$bestsellersTables = array($installer->getTable('sales/bestsellers_aggregated_daily'),
    $installer->getTable('sales/bestsellers_aggregated_monthly'),
    $installer->getTable('sales/bestsellers_aggregated_yearly'));

foreach ($bestsellersTables as $table) {
    $installer->getConnection()->addColumn(
        $table,
        'product_type_id',
        array(
            'type'     => Varien_Db_Ddl_Table::TYPE_TEXT,
            'length'   => 32,
            'default'  => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE,
            'nullable' => false,
            'after'    => 'product_id',
            'comment'  => 'Product Type Id'
        )
    );
}

$installer->endSetup();

Often its just that Cache was not cleaned after pulling/adding Magento modifications. If this not the case I would recommend to set the value of "sales_setup" from 1.6.0.10 back to 1.6.0.9 in table core_resource

0

Rename your file app/etc/local.xml to app/etc/local.xmlBKP and run the install process using the data in this one.

Then remove local.xml that was automatically generated and rename the file app/etc/local.xmlBKP to app/etc/local.xml again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.