【问题标题】:Only one product on homepage using CMS Page in Magento 1.9.0.1在 Magento 1.9.0.1 中使用 CMS 页面的主页上只有一个产品
【发布时间】:2015-04-18 07:44:53
【问题描述】:

显示一个产品后,catalog/product/list.pthml 似乎不再执行。

我关注了这些steps 但它不起作用。我也尝试直接更改 list.pthml 中的指示行。

我还重新索引以检查产品是否可用、已启用等。

有什么办法可以解决这个问题吗?

【问题讨论】:

  • 这可能有其他原因。你检查过日志吗?您可以右键单击->查看页面源代码(查看它是否在某处停止)或直接检查 PHP 日志以查看它抛出的错误。此外,如果您的缓存已启用,您也应该将其删除。

标签: magento content-management-system


【解决方案1】:

我做了第一个努力。我用以下代码替换了指示的行:

<?php
                        if ($this->getChild('name.after')) {
                        $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
                        foreach ($_nameAfterChildren as $_nameAfterChildName) {
                        $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
                        $_nameAfterChild->setProduct($_product);
                        echo $_nameAfterChild->toHtml();
                        }
                        }
?>

在底部

<?php
if ($this->getChild('after')) {
$_afterChildren = $this->getChild('after')->getSortedChildren();
foreach ($_afterChildren as $_afterChildName) {
$_afterChild = $this->getChild('after')->getChild($_afterChildName);
//set product collection on after blocks
$_afterChild->setProductCollection($_productCollection);
echo $_afterChild->toHtml();
}
}
?>

现在它正在工作,我可以显示所有内容。 PHP 日志只有 2 个“文件不存在”错误。

但现在设计没有响应。它不再格式化了。 ???

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多