可配置产品未显示在前端(目录和搜索页面)

YWS*_*WSW 1 magento configurable-product magento-1.7

我的可配置产品未显示在前端.在后端,Magento似乎将可配置产品列为0库存(尽管可配置产品的数量没有输入框).

  1. 他们所有的产品都设置为"库存",数量大于零
  2. 可配置产品本身也设置为"库存"[没有数量设置 - 如上所述]
  3. 重新索引数据并刷新缓存
  4. 使用Magento 1.7.0.2
  5. 这里使用流行的扩展Simple Configurable Products

请指教...

YWS*_*WSW 12

这是适合我的解决方案:

问题出在简单可配置产品(OrganicInternet)中使用的代码

我想要注意的是,我一次有两个单独的问题 - 上面,产品价格指数拒绝被索引(我收到了这条消息:无法初始化索引器进程,这被解释为SQLSTATE [21S01]:Insert值列表与列列表不匹配:1136列计数与第1行的值计数不匹配)

事实证明这两个问题都是相关的,并且在下面解决了这两个问题;)

  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'),
    ));
Run Code Online (Sandbox Code Playgroud)

至:

$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'),
    ));
Run Code Online (Sandbox Code Playgroud)

$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'
    ));
Run Code Online (Sandbox Code Playgroud)

$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'
    ));
Run Code Online (Sandbox Code Playgroud)

来源:主要的问题连同这个(但请注意,正确的代码是"base_group_price" =>新Zend_Db_Expr("pi.group_price"),而不是"P1"base_group_price" =>新Zend_Db_Expr(base_ group_price"),

  1. 另外,在文件中:/ app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php

更改

$this->cloneIndexTable(true);
Run Code Online (Sandbox Code Playgroud)

$this->clearTemporaryIndexTable();
Run Code Online (Sandbox Code Playgroud)

来源:这里

我花了几个小时来弄明白这一点所以我写了这篇文章,以帮助其他人浪费所有的时间.

祝你好运!