1

please visit this link : http://hotwheelstoys.in/mobileapp/boys-toys.html

at the left side you can see "SHOP BY" , below that "CHARACTAR".

below dropdown values. here i want to hide the last dropdown "Hawkeye"

I dont want to delete it from backend. but i want to hide this.

if this attribute option have more than one ,than also i want to hide it. all i need is i want to hide one attribute option.

app/design/frontend/base/default/template/em_layerednavigation/filter/checkbox.phtml

    <?php if ($removeUrl = Mage::helper('layerednavigation')->getRemoveUrl($this->_filter)): ?>
<div class="filter-act">
    <a class="btn-remove" href="<?php echo $removeUrl ?>" title="<?php echo $this->__('Clear All') ?>"><?php echo $this->__('Clear All') ?></a>
</div>
<?php endif ?>

<ol>
<?php foreach ($this->getItems() as $_item): ?>
    <li>
        <?php $inputId = $_item->getFilter()->getRequestVar().'_'.$_item->getValue() ?>
        <input type="checkbox" id="<?php echo $inputId ?>" name="<?php echo $_item->getFilter()->getRequestVar(); ?>" value="<?php echo $this->urlEscape($_item->getUrl(true)) ?>" <?php if ($_item->isSelected()):?>checked="checked"<?php endif ?> />
        <label for="<?php echo $inputId ?>"><?php echo $_item->getLabel() ?> 
            <?php if ($this->shouldDisplayProductCount()): ?>
            <span class="em_count">(<?php echo $_item->getCount() ?>)</span>
            <?php endif ?>
        </label>
    </li>
<?php endforeach ?>
</ol>
0

1 Answer 1

2

I am not sure if you are using third party layered navigation or default Magento layered navigation.

In default Magento layered navigation in the file you can do something like this

app/design/frontend/base/default/template/catalog/layer/filter.phtml

<ol>
    <?php foreach ($this->getItems() as $_item): ?>
        <li>
            <?php if ($_item->getCount() > 0): ?>
                <a href="<?php echo $this->urlEscape($_item->getUrl()) ?>">

                    <?php if($_item->getLabel() == 'Hawkeye'):?>
                        <?php continue; ?>
                    <?php endif;?>

                    <?php echo $_item->getLabel() ?>
                </a>
            <?php else: echo $_item->getLabel() ?>
            <?php endif; ?>
            <?php if ($this->shouldDisplayProductCount()): ?>
                (<?php echo $_item->getCount() ?>)
            <?php endif; ?>
        </li>
    <?php endforeach ?>
</ol>

If your Magento using this file from base you will need to take it in your theme. If you are using third party module find your file and you can do same thing over there.

EDIT

<?php if ($removeUrl = Mage::helper('layerednavigation')->getRemoveUrl($this->_filter)): ?>
<div class="filter-act">
    <a class="btn-remove" href="<?php echo $removeUrl ?>" title="<?php echo $this->__('Clear All') ?>"><?php echo $this->__('Clear All') ?></a>
</div>
<?php endif ?>

<ol>
<?php foreach ($this->getItems() as $_item): ?>

<?php if($_item->getLabel() == 'Hawkeye'):?>
    <?php continue; ?>
<?php endif;?>
    <li>
        <?php $inputId = $_item->getFilter()->getRequestVar().'_'.$_item->getValue() ?>
        <input type="checkbox" id="<?php echo $inputId ?>" name="<?php echo $_item->getFilter()->getRequestVar(); ?>" value="<?php echo $this->urlEscape($_item->getUrl(true)) ?>" <?php if ($_item->isSelected()):?>checked="checked"<?php endif ?> />
        <label for="<?php echo $inputId ?>"><?php echo $_item->getLabel() ?> 
            <?php if ($this->shouldDisplayProductCount()): ?>
            <span class="em_count">(<?php echo $_item->getCount() ?>)</span>
            <?php endif ?>
        </label>
    </li>
<?php endforeach ?>
</ol>
6
  • thanks for reply . i will check and let you know, right now i am struck with live site problem Commented Jan 7, 2016 at 8:05
  • we are using extension, i updated the module code in question. please check it. Commented Jan 8, 2016 at 5:39
  • this is the main file. options will render from another file. <dd><?php echo $_filter->getHtml() ?></dd> Commented Jan 9, 2016 at 9:48
  • i updated the file path and file code, please check.... let me know if it is a wrong file, i will upload the complete extension files. Commented Jan 9, 2016 at 10:40
  • edited my code as per your file. try it Commented Jan 9, 2016 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.