Skip to content
This repository was archived by the owner on Mar 9, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function init()
$this->setUnit($attribute->getUnit());
$this->setLinkCount($attribute->getLinkCount());
} else {
$this->setTemplate('factfinder/asn/layer/filter/filter.phtml');
$this->setUnit($attribute->getUnit());
$this->setLinkCount($attribute->getLinkCount());
$this->setIsMultiselect($attribute->getIsMultiselect());
Expand All @@ -65,4 +66,4 @@ public function init()
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
<reference name="head">
<action method="addJs"><script>factfinder/jXHR.js</script></action>
<action method="addJs"><script>factfinder/suggest.js</script></action>
<action method="addJs"><script>factfinder/filters.js</script></action>
<action method="addCss"><stylesheet>css/factfinder_suggest.css</stylesheet></action>
</reference>
<reference name="header">
<block type="factfinder_suggest/topSearch" name="top.search" as="topSearch" template="factfinder/suggest/advancedsuggest.phtml"/>
</reference>
</factfinder_suggest_enabled>

</layout>
</layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
/**
* FACTFinder_Asn
*
* @category Mage
* @package FACTFinder_Asn
* @author Flagbit Magento Team <magento@flagbit.de>
* @copyright Copyright (c) 2018, Flagbit GmbH & Co. KG
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
* @link http://www.flagbit.de
*/
/**
* Filters HTML Template
*/
?>
<?php /** @var FACTFinder_Asn_Block_Catalog_Layer_Factfinder $this */ ?>

<ol class="filters-items">
<?php /** @var FACTFinder_Asn_Model_Layer_Filter_Item $_item */ ?>
<?php $items = $this->getItems(); ?>
<?php $i = 0; ?>
<?php $limit = $this->getLinkCount(); ?>
<?php foreach ($items as $_item): ?>
<?php $isDisplayed = $i < $limit; ?>
<li class="toggle-item<?php echo ($isDisplayed ? '' : '-hidden'); ?>">
<?php if ($_item->getCount() > 0): ?>
<a rel="nofollow" href="<?php echo $this->escapeUrl($_item->getUrl()) ?>">
<?php echo $_item->getLabel(); ?>
</a>
<?php else: ?>
<?php echo $_item->getLabel() ?>
<?php endif; ?>
(<?php echo $_item->getCount() ?>)
</li>
<?php $i++; ?>
<?php endforeach ?>
<?php if ($this->getLinkCount() < count($items)): ?>
<li class="toggle-refinements">
<a href="#"
class="nav-attribute more-refinements"
rel="nofollow">
<?php echo $this->__('View more'); ?>
</a>
</li>
<li class="toggle-refinements" style="display:none">
<a href="#"
class="nav-attribute less-refinements"
rel="nofollow">
<?php echo $this->__('View less'); ?>
</a>
</li>
<?php endif; ?>
</ol>
22 changes: 22 additions & 0 deletions src/js/factfinder/filters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* FACTFinder_Filters
*
* @category Mage
* @package FACTFinder_Filters
* @author Flagbit Magento Team <magento@flagbit.de>
* @copyright Copyright (c) 2018 Flagbit GmbH & Co. KG
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
* @link http://www.flagbit.de
*
*/
jQuery(document).ready(function () {
jQuery('ol.filters-items li.toggle-refinements a').click(function (event) {
event.stopPropagation();
event.preventDefault();
var $this = $(this);
jQuery($this).parent().toggle();
jQuery($this).parent().siblings('.toggle-refinements').toggle();
jQuery($this).parent().siblings('.toggle-item-hidden').slideToggle('fast');
return false;
});
});
6 changes: 5 additions & 1 deletion src/skin/frontend/base/default/css/factfinder_suggest.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@
.form-search .search-autocomplete.advanced-suggest span.thumbnail {
float:left;
margin-right: .3em;
}
}

.toggle-item-hidden {
display: none;
}