我有一个大约20 25个值的属性。像
Briolette
Baguette
Bullet Cabochon
Cushion
Cushion Cabochon
Emerald Cut
Fancy Cut
Fancy cut Cabochon
Half Moon
Heart Shape
Lotus
Marquise
Oval
Oval Cabochon
Pear Shape
Pear Shape Cabochon
Princess Cut
Round
Round Cabochon
Square
Trillion
Trillion Cabochon
我正在使用magento的aw_layerednavigation扩展来在前端显示它们。他们带着一个复选框进入下拉列表。 我需要将它们分组为:
o Combine Oval and Oval Cabochon under Oval
o Combine Cushion Cabochon under Cushion
o Combine square and Princess cut, rename: Square/Princess
o Group the following under “other”: Baguette, briolette, half moon, fancy cut, fancy cut cabochon, bullet cabochon
Group Pear Shape Cabochon under Pear shape
Group Trillion Cabochon under Trillion
Group Round cabochon under round
这样做了吗?
以下是atrributes值来自下拉列表的layer.phtml代码:
<?php if($this->canShowBlock()): ?>
<div class="block block-layered-nav" id="aw-ln-filters">
<!-- div class="block-title">
<strong><span><?php //echo $this->__('Shop By') ?></span></strong>
</div -->
<div class="block-content toggle-content">
<script type="text/javascript">
var awLnUpdaterInstance = new awLnUpdater();
</script>
<?php if($this->isLayerHasAppliedValue()): ?>
<span class="aw-ln-clear-all">
(<a href="javascript:void(0)"><?php echo $this->__("Clear All");?></a>)
</span>
<?php endif;?>
<p class="block-subtitle block-subtitle--filter"">
<?php //echo $this->__('Shopping Options') ?>
</p>
<nav id="primary_nav_wrap">
<ul id="aw-ln-filters-container">
<?php $i=0; foreach ($this->getFilterList() as $_filter): ?>
<?php if($this->getItemCountByFilter($_filter)): ?>
<li>
<a href="javascript:void(0);"><?php echo $_filter->getTitle() ?></a>
<?php /*if ($this->isFilterHasAppliedValues($_filter)):?>
<span class="aw-ln-filter-clear">
(<a href="javascript:void(0)"><?php echo $this->__("Clear");?></a>)
</span>
<?php else : ?>
<?php echo $this->renderHelp($_filter); ?>
<?php endif;*/?>
<?php
?>
<ul id="<?php echo ++$i; ?>-unique" class="common-class">
<li>
<dd>
<?php echo $this->renderFilter($_filter); ?>
</dd>
</li>
</ul>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</nav>
<script type="text/javascript">
decorateDataList('aw-ln-filters-container');
//decorateDataList('aw-ln-filters');
awLnUpdaterInstance.init({
layerContainerElSelector: ".block-layered-nav",
productsContainerElSelectorList: [".category-view", ".results-view", ".category-products", ".category_cms_block"],
emptyProductsContainerElSelectorList: [".note-msg"],
toolbarContainerElSelectorList: [
".category-view .toolbar",
".results-view .toolbar",
".category-products .toolbar"
],
clearAllElSelector: '.aw-ln-clear-all',
clearFilterElSelector: '.aw-ln-filter-clear',
isAjax: <?php echo Zend_Json::encode($this->isAjax());?>,
overlaySettings: <?php echo Zend_Json::encode($this->getOverlaySettings());?>,
overlayCssClass: 'aw-ln-overlay'
});
</script>
</div>
</div>
<?php endif; ?>