如果仅对将默认分层导航转换为复选框感兴趣,则该解决方案非常简单,并将其放在此处。
编辑app/design/frontend/ourpackage/ourtheme/template/catalog/layer/filter.phtml
文件代码,如下所示:
<ol>
<?php foreach ($this->getItems() as $_item): ?>
<li>
<?php if ($_item->getCount() > 0): ?>
<form>
<span class="check-box">
<input type="checkbox" name="vehicle" onclick='window.location.assign("<?php echo $this->urlEscape($_item->getUrl()) ?>")'/>
</span>
<a href="<?php echo $this->urlEscape($_item->getUrl()) ?>">
<?php echo $_item->getLabel() ?>
<?php if ($this->shouldDisplayProductCount()): ?>
<span class="count">(<?php echo $_item->getCount() ?>)</span>
<?php endif; ?>
</a>
</form>
<?php else: ?>
<form>
<span class="check-box">
<input type="checkbox" name="vehicle" onclick='window.location.assign("<?php echo $this->urlEscape($_item->getUrl()) ?>")'/>
</span>
<span>
<?php echo $_item->getLabel(); ?>
<?php if ($this->shouldDisplayProductCount()): ?>
<span class="count">(<?php echo $_item->getCount() ?>)</span>
<?php endif; ?>
</span>
</form>
<?php endif; ?>
</li>
<?php endforeach ?>
</ol>
该解决方案的改进版本此。因此,荣誉也归功于此人。