0

我已经将我的 Magento 商店从一台使用 PHP 5.3 的服务器迁移到一台使用 5.4 的服务器。现在定价已经关闭。在列表/网格模式下,它似乎使用 getPriceHtml($_product, true); 显示分组价格,而不仅仅是一个简单的价格(例如,从价格开始,而不仅仅是价格)。

在产品详细信息页面上,使用 getTirePriceHtml() 没有显示任何价格;

当我使用旧的(默认)模板时,它会正确显示价格,而请求价格的两个代码之间没有区别。

如果到处查看 Magento 是否有任何配置错误,但一切似乎都很好,并且产品在管理产品管理中显示为简单产品。

我试图重新导入数据库和文件,并且一直在寻找几天来尝试解决这个问题。还没有解决方案,所以我希望你们中的某个人可能知道一些事情。

我的 list.phtml 的代码:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Product list template
 *
 * @see Mage_Catalog_Block_Product_List
 */
?>
<?php $_productCollection=$this->getLoadedProductCollection() ?>
<?php if(!$_productCollection->count()): ?>
<div class="note-msg">
    <?php echo $this->__('There are no products matching the selection.') ?>
</div>
<?php else: ?>

<?php echo $this->getToolbarHtml() ?>
<?php // List mode ?>
<?php if($this->getMode()!='grid'): ?>
<?php $_iterator = 0; ?>
<div class="listing-type-list catalog-listing">
<?php foreach ($_productCollection as $_product): ?>
    <div class="listing-item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
        <?php // Product Image ?>
        <div class="product-image">
            <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getSmallImageLabel()) ?>">
                <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
            </a>
        </div>

        <?php // Product description ?>
        <div class="product-shop">
            <h5 class="product-title"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName())?></a></h5>
            <?php echo $this->getPriceHtml($product, true) ?>
            <?php if($_product->isSaleable()): ?>
            <button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
            <?php else: ?>
            <div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
            <?php endif; ?>
                    <div class="moreinfo">
             <a class="form-button" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getSmallImageLabel()) ?>">
                Meer informatie
            </a>
        </div>
            <div class="clear"></div>
        </div>

    </div>
<?php endforeach; ?>
</div>

<?php else: ?>

<?php // Grid Mode ?>
<div class="listing-type-grid catalog-listing">
<?php $_collectionSize = $_productCollection->count() ?>
    <?php $_columnCount = $this->getColumnCount(); ?>
    <?php $i=0; foreach ($_productCollection as $_product): ?>
        <?php if($i++%$_columnCount==0): ?>
        <ol class="grid-row">
        <?php endif; ?>
            <li class="item">
                <p class="product-image">
                    <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>">
                        <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
                    </a>
                </p>
                <h5 class="product-title"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></h5>
                <?php echo $this->getPriceHtml($_product, true) ?>
                <?php print_r($_product); ?>
                <?php if($_product->isSaleable()): ?>
                    <button type="button" class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
                <?php else: ?>
                <div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
                <?php endif; ?>
                <div class="moreinfo">
             <a class="form-button" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getSmallImageLabel()) ?>">
                Meer informatie
            </a>
        </div>
            </li>
        <?php if($i%$_columnCount==0 || $i==$_collectionSize): ?>
        </ol>
        <?php endif; ?>
    <?php endforeach ?>
    <script type="text/javascript">decorateGeneric($$('.grid-row'), ['last', 'odd', 'even']);</script>
</div>
<?php endif; ?>
<?php echo $this->getToolbarHtml() ?>
<?php endif; ?>
4

1 回答 1

0

我最终解决了它。我在我的模板文件夹中忽略了一个名为 price.html 的文件。

通过将此文件复制到我的模板中,我已经纠正了这个问题。

于 2013-08-16T09:53:54.993 回答