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

时间:2013-01-27 20:03:17

标签: magento magento-1.7 configurable-product

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

  1. 他们的所有产品都设置为“库存”且数量大于零
  2. 可配置产品本身也设置为“库存”[没有数量设置 - 如上所述]
  3. 重新编制数据索引并刷新缓存
  4. 使用Magento 1.7.0.2
  5. 使用常用的扩展程序Simple Configurable Products here
  6. 请告知......

1 个答案:

答案 0 :(得分:12)

以下是适合我的解决方案:

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

我想要注意的是,我一次遇到两个单独的问题 - 以上,产品价格指数拒绝被编入索引(我收到了这条消息:无法初始化索引器进程,解释为 SQLSTATE [21S01]:插入值列表与列列表不匹配:1136列数与第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 issuethis(但请注意,正确的代码是'base_group_price'=>新的Zend_Db_Expr('pi.group_price'),和不是'base_group_price'=>新Zend_Db_Expr('pi。 base _ group_price'),

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

      $this->cloneIndexTable(true);
      

      $this->clearTemporaryIndexTable();
      

      来源:here

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

      祝你好运!

相关问题