试图用一个自定义过滤器自定义主题内时,遇到了这个错误。
我已经建立了其在设置属性的新属性“is_featured”和。 我做了分配它作为特色产品(是/否选择)
我的主页(CMS中的部分),包括下面的“面板”
<block type="catalog/product" name="catalog.product_featured_list" template="catalog/product/featured_list.phtml" after="-"/>
featured_list.phtml看起来是这样的:
<?php
$storeId = Mage::app()->getStore()->getId();
$_productCollection=Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect(array('name', 'url', 'small_image', 'price', 'short_description'))
->addAttributeToFilter('is_featured', 1)
->addAttributeToFilter('status', 1)
->setPageSize(3)
->setStoreId($storeId)
->addStoreFilter($storeId);
$_helper = $this->helper('catalog/output');
?>
<?php if($_productCollection->count()): ?>
<section class="content-box clearfix">
<header>
<h2>Featured products</h2>
</header>
<ul class="featured-products">
<?php foreach ($_productCollection as $_product): ?>
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
<li>
<h3>
<a href="<?php echo $_product->getProductUrl(); ?>" title="<?php echo $_productNameStripped; ?>">
<?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?>
</a>
</h3>
<a href="<?php echo $_product->getProductUrl(); ?>" title="<?php echo $_productNameStripped; ?>">
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(212); ?>" width="200" height="200" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
</a>
<div>
<ul class="clearfix">
<li>From £<?php echo number_format($_product->price, 2) ?></li>
<li>
<?php
$desct = nl2br($this->htmlEscape($_product->getShortDescription()));
$desct = strip_tags($_product->getShortDescription());
?>
<p>
<?
echo Mage::helper('core/string')->truncate($desct, '100');
?>
<a href="<?php echo $_product->getProductUrl(); ?>" title="<?php echo $_productNameStripped; ?>">
<?php echo $this->__('more details'); ?>
</a>
</p>
</li>
<li>
<form action="<?php echo $this->helper('checkout/cart')->getAddUrl($_product); //echo $this->getAddToCartUrl($_product); ?>" class="product-list-add-to-cart" method="get" id="product_addtocart_form_<?php echo $_product->getId()?>"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
<?php if(!$_product->isGrouped()): ?>
<label for="qty"><?php echo $this->__('Qty') ?>:</label>
<input type="text" class="input-text qty" name="qty" id="qty" maxlength="12" value="<?php echo ($this->getMinimalQty($_product)?$this->getMinimalQty($_product):1) ?>" />
<input type="hidden" name="product" value="<?php echo $_product->getId()?>" />
<?php endif; ?>
<button type="button" class="button" onclick="this.form.submit()"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
</form>
</li>
</ul>
</div>
</li>
<?php endforeach; ?>
</ul>
</section>
<?php endif; ?>
好像这个问题是在块的开始收集。 (我可以删除该面板形成的主页,网站加载罚款)
我敢肯定,我把所有可用的上述的属性(is_featured看起来是唯一的自定义一个)
(这个主题是继承的,所以我不是100%它是如何工作的熟悉!我只是跨复制它)