这是对我有用的解决方案:
问题在于简单可配置产品(有机互联网)中使用的代码
我想指出,我同时遇到了两个单独的问题 - 上述问题,并且产品价格指数拒绝被索引(我收到此消息:无法初始化索引器进程,这被解释为 SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1)
事实证明这两个问题是相关的,下面解决了它们;)
- 在文件/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php中
改变:
$select->columns(array(
'entity_id' => new Zend_Db_Expr('e.entity_id'),
'customer_group_id' => new Zend_Db_Expr('pi.customer_group_id'),
'website_id' => new Zend_Db_Expr('cw.website_id'),
'tax_class_id' => new Zend_Db_Expr('pi.tax_class_id'),
'orig_price' => new Zend_Db_Expr('pi.price'),
'price' => new Zend_Db_Expr('pi.final_price'),
'min_price' => new Zend_Db_Expr('pi.final_price'),
'max_price' => new Zend_Db_Expr('pi.final_price'),
'tier_price' => new Zend_Db_Expr('pi.tier_price'),
'base_tier' => new Zend_Db_Expr('pi.tier_price'),
));
到:
$select->columns(array(
'entity_id' => new Zend_Db_Expr('e.entity_id'),
'customer_group_id' => new Zend_Db_Expr('pi.customer_group_id'),
'website_id' => new Zend_Db_Expr('cw.website_id'),
'tax_class_id' => new Zend_Db_Expr('pi.tax_class_id'),
'orig_price' => new Zend_Db_Expr('pi.price'),
'price' => new Zend_Db_Expr('pi.final_price'),
'min_price' => new Zend_Db_Expr('pi.final_price'),
'max_price' => new Zend_Db_Expr('pi.final_price'),
'tier_price' => new Zend_Db_Expr('pi.tier_price'),
'base_tier' => new Zend_Db_Expr('pi.tier_price'),
'group_price' => new Zend_Db_Expr('pi.group_price'),
'base_group_price' => new Zend_Db_Expr('pi.group_price'),
));
和
$outerSelect->columns(array(
'customer_group_id',
'website_id',
'tax_class_id',
'orig_price',
'price',
'min_price',
'max_price' => new Zend_Db_Expr('MAX(inner.max_price)'),
'tier_price',
'base_tier',
#'child_entity_id'
));
到
$outerSelect->columns(array(
'customer_group_id',
'website_id',
'tax_class_id',
'orig_price',
'price',
'min_price',
'max_price' => new Zend_Db_Expr('MAX(inner.max_price)'),
'tier_price',
'base_tier',
'group_price',
'base_group_price',
#'child_entity_id'
));
来源:main issue 和 this(但请注意正确的代码是 'base_group_price' => new Zend_Db_Expr('pi.group_price'), 而不是 ' base_group_price' => new Zend_Db_Expr('pi.base_group_price'),
- 另外,在文件中:/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php
改变
$this->cloneIndexTable(true);
到
$this->clearTemporaryIndexTable();
来源:here
我花了几个小时才弄清楚这一点,所以我写这篇文章是为了帮助其他人不要浪费所有的时间。
祝你好运!