【问题标题】:configurable products are not showing up in the front end (catalog and search pages)可配置产品未显示在前端(目录和搜索页面)
【发布时间】:2013-01-11 04:15:21
【问题描述】:

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

  1. 他们所有的产品都设置为“有货”并且数量超过零
  2. 可配置产品本身也设置为“有货”[没有数量设置 - 如上所述]
  3. 数据被重新索引并且缓存被刷新
  4. 使用 Magento 1.7.0.2
  5. 使用流行的扩展简单可配置产品here

请指教...

【问题讨论】:

  • 是否启用?此外,对于每个可配置选项,您都需要一个包含所有子级关联的父级产品。请参阅magento admin demo 以及他们是如何做到的。这是frontend demo供参考
  • 是的,它们都已启用。此外,每个可配置产品都有与之相关联的产品。
  • 检查您的主题文件是否有错误。尝试切换回默认的 magento 主题。如果它们出现在那里,那么您的问题就在您的主题中。如果它们没有出现在那里,请开始禁用模块的输出,例如 Simple Configurable Products。如果这不起作用,则通过 ftp/ssh/scp 重新加载 magento 的核心。最后,如果这不起作用check and repair your database
  • 好的...尝试了所有方法,但似乎没有任何效果...

标签: magento magento-1.7 configurable-product


【解决方案1】:

这是对我有用的解决方案:

问题在于简单可配置产品(有机互联网)中使用的代码

我想指出,我同时遇到了两个单独的问题 - 上述问题,并且产品价格指数拒绝被索引(我收到此消息:无法初始化索引器进程,这被解释为 SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 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'),
    ));

到:

$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' => new Zend_Db_Expr('pi.group_price'), 而不是 ' base_group_price' => new Zend_Db_Expr('pi.base_group_price'),

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

改变

$this->cloneIndexTable(true);

$this->clearTemporaryIndexTable();

来源:here

我花了几个小时才弄清楚这一点,所以我写这篇文章是为了帮助其他人不要浪费所有的时间。

祝你好运!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-24
    • 2012-01-16
    • 2017-06-14
    • 1970-01-01
    相关资源
    最近更新 更多