去掉magento分类页左侧的分类导航
本次以magento1.4的default模板为例,其它版本和模板注意文件路径和代码差别。
文件路径:app/design/frontend/default/你的模板文件夹/catalog/layer/view.phtml 若无此文件请将app/design/frontend/base/default/template/catalog/layer/view.phtml 文件拷贝到此处。 (开启magento后台路径提醒,就可以找到此文件)
原始代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <div class="block-content">
<?php echo $this->getStateHtml() ?>
<?php if($this->canShowOptions()): ?>
<p class="block-subtitle"><?php echo $this->__('Shopping Options') ?></p>
<dl id="narrow-by-list">
<?php $_filters = $this->getFilters() ?>
<?php foreach ($_filters as $_filter): ?>
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>
<script type="text/javascript">decorateDataList('narrow-by-list')</script>
<?php endif; ?>
</div> |
修改后的代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <div class="block-content">
<?php echo $this->getStateHtml() ?>
<?php if($this->canShowOptions()): ?>
<p class="block-subtitle"><?php echo $this->__('Shopping Options') ?></p>
<dl id="narrow-by-list">
<?php $_filters = $this->getFilters() ?>
<?php foreach ($_filters as $_filter): ?>
<?php if($_filter->getItemsCount() && $_filter->getName() != "Category"): ?>
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>
<script type="text/javascript">decorateDataList('narrow-by-list')</script>
<?php endif; ?>
</div> |
ok, 刷新页面, 在看看吧
