SQLSTATE[42S02]: Base table or view not found: 1146 Table XXXXXX

安装Galathemes.com theme插件。 首页无法打开,提示SQLSTATE[42S02]: Base table or view not found: 1146 Table “sales_flat_order_item” doesn’t exist”错误
发现MYSQL添加了数据表前缀
需要修改“app/code/local/EM/Bestsellerproducts/Block/” List.php中

SELECT DISTINCT SUM( order_items.qty_ordered ) AS  `ordered_qty` ,  `order_items`.`name` AS  `order_items_name` ,  `order_items`.`product_id` AS  `entity_id` ,  `e`.`entity_type_id` ,  `e`.`attribute_set_id` , `e`.`type_id` ,  `e`.`sku` ,  `e`.`has_options` ,  `e`.`required_options` ,  `e`.`created_at` ,  `e`.`updated_at`
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.entity_id = order_items.product_id
INNER JOIN `前缀_catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id
AND product_website.website_id = '1'
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.category_id
IN ( ".$strCategories." )
WHERE (
parent_item_id IS NULL
)
GROUP BY `order_items`.`product_id`
HAVING (
SUM( order_items.qty_ordered ) >0
)
ORDER BY `ordered_qty` DESC
LIMIT 0 ,".$this->getLimitCount()."

2处修改。
END

———————以下更新2015年2月10日—————–
如果缺少
Error – SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘example_magento.core_directory_storage’ doesn’t exist.
After upgrading to Magento 1.5, you may get the following error when trying to upload an image using the built-in WYSIWYG interface:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘example_magento.core_directory_storage’ doesn’t exist.

To fix this you need to create the table.

1) Backup your database
2) Using phpMyAdmin or other SQL Manager, run the following SQL update commands:

SET FOREIGN_KEY_CHECKS = 0; 

CREATE TABLE IF NOT EXISTS `core_directory_storage` (
`directory_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`path` varchar(255) NOT NULL DEFAULT '',
`upload_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`parent_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`directory_id`),
UNIQUE KEY `IDX_DIRECTORY_PATH` (`name`, `path`),
KEY `parent_id` (`parent_id`),
CONSTRAINT `FK_DIRECTORY_PARENT_ID` FOREIGN KEY (`parent_id`)
REFERENCES `core_directory_storage` (`directory_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Directory storage'; SET FOREIGN_KEY_CHECKS = 1;

Magento产品列表按照日期排序

[magento patch]/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php

    protected $_direction           = 'asc';

改为

    protected $_direction           = 'desc';

magento问题集2的更多相关文章

  1. magento问题集3

    MISSING LANGUAGE FILES OR DIRECTORIES A:已经装了俄语包,也是russian目录,在前台也可以用.但是在后台最上面总是显示MISSING LANGUAGE FIL ...

  2. magento问题集

    magento产品页面价格出现2遍 In app\design\frontend\default\default\template\catalog\product\view\type\Simple.p ...

  3. magento 小问题解决方案集

    magento错误 Mage registry key "_singleton/core/resource" already exists解决方法:1.清理magento的var/ ...

  4. Magento table rates表运费设置

    在magento中集成了Table rate表运费,这种运输方式.表运费就是我们自己写个运费表,根据距离和商品重量设置运费,制做成一张csv格式的表,导入到magento中,来实现运费的控制. 在我的 ...

  5. Redis集群部署

    1.1.1redis简介 Redis 是一个开源的使用 ANSI C 语言编写.支持网络.可基于内存亦可持久化的日志 型. Key-Value数据库 1.1.2redis常见使用场景 1.会话缓存(S ...

  6. Magento创建configurable产品的要点

    接着上一篇用API创建可配置的产品Configurable Product说事.Magento的产品类型可分为Simple Product.Group Product.Configurable Pro ...

  7. magento -- 如何为商品分类(category)添加自定义属性

    在magento 中,由于使用了强大的EAV设计方法,我们可以很方便的给商品添加任意数量的属性.然而magento 没有给我们提供给商品分类添 加属性的功能.尽管我们知道magento所采用的EAV设 ...

  8. magento搜索属性值的设置方法

    前台特性(Frontend Properties)在快速搜索中应用(Use in quick search) - 开启此选项,在客户使用Header中的 搜索功能时Magento将搜索所有产品这个At ...

  9. magento产品eav笔记【持续跟新...】

    //magento把产品信息分在子表中,最顶上的表是catalog_product_entity,仅仅包含产品的信息(SKU) //表eav_attribute,这张表在magento里为全部不 同的 ...

随机推荐

  1. c#和数据库技术基础之程序设计集散地-数据库

    数据库,不明觉厉,今天我们就来数据库的神秘面纱 1.使用数据库的必要性 随着互联网技术的高速发展,截止到2013年我国网民的数量已接近6亿,网民数量的增长同事带动网上购物,微博,网络视频等新产业的发展 ...

  2. (巨坑)改了tpl文件之后,前端效果没反应

    通常前端修改很小的部分代码,并不会立即显示出效果.比如,原来是 ,修改后是 虽然只是加多了一个函数,但是作用很大,这种情况下,可能是由于浏览器缓存的原因,修改后的代码没有被重新加载.这个时候,只需要在 ...

  3. CI框架 数据库批量插入 insert_batch()

    使用CI框架的AR操作:insert_batch()可以减少访问数据库的次数.一次访问即可. 示例1: $data = array( array( 'title' => 'My title' , ...

  4. BZOJ1727 [Usaco2006 Open]The Milk Queue 挤奶队列

    贪心...我怎么不会QAQ[捂脸熊] 对于1.2两头牛,如果1号牛要排在2号牛前面才能时间更少,则 $$max(A_1 + B_1 + B_2, \ A_1 + A_2 + B_2) \le max( ...

  5. python使用urllib2抓取网页

    1.使用python的库urllib2,用到urlopen和Request方法. 2.方法urlopen原形 urllib2.urlopen(url[, data][, timeout]) 其中: u ...

  6. 使用AlarmManager设置闹钟----之二

    import android.media.MediaPlayer;import android.os.Bundle;import android.app.Activity;import android ...

  7. [转载]java NIO详解

    Java NIO(New IO)是从Java 1.4版本开始引入的一个新的IO API,可以替代标准的Java IO API.下面的文章写的很详细,还配有插图,有助于深入学习和理解java NIO 文 ...

  8. winform的comboBox使鼠标滑轮修改值失效

    目标: winform窗体很多combobox下拉框,当他们其中的一个获得焦点的时候,如果滚动鼠标就会改变下拉框的值,要实现让鼠标滚轮不对下拉框的值造成影响 如下代码直接拷贝粘贴,不用修改 方法一: ...

  9. Rhel6-hadoop分布式部署配置文档

    理论基础: Hadoop 分布式文件系统架构 HDFS 负责大数据存储 MapReduce 负责大数据计算 namenode  master守护进程 datanode  slaves上负责存储的进程 ...

  10. 经典线程同步 关键段CS

    上一篇<秒杀多线程第四篇 一个经典的多线程同步问题>提出了一个经典的多线程同步互斥问题,本篇将用关键段CRITICAL_SECTION来尝试解决这个问题. 本文首先介绍下如何使用关键段,然 ...