Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8520325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:30:11+00:00 2026-06-11T06:30:11+00:00

I am using dropdowns to display my layered navigation attribute values. I have 3

  • 0

I am using dropdowns to display my layered navigation attribute values. I have 3 filters – price, size and color.
This is what I am trying to do:
1. Get dropdowns for the layered navigation filters.
2. Get the attribute label/name to show up as the first option. Currently, my code puts a default “Choose an Option” value for each dropdown, which I would like to replace with something like “Choose Price”, “Choose Size” and “Choose Color”.
Here is my current code for template/catalog/layer/filter.phtml. The dropdown works, but I am stuck at getting the attribute label instead of “Choose an Option”

<select onchange="setLocation(this.value)">
<option value='' disabled selected style='display:none;'>Choose an Option</option>
</option> 
<?php foreach ($this->getItems() as $_item): ?>
<option
    <?php if ($_item->getCount() > 0): ?>
    value="<?php echo $this->urlEscape($_item->getUrl()) ?>"><?php echo $_item->getLabel() ?>
    <?php else: echo '>' . $_item->getLabel() ?>
    <?php endif; ?>
    (<?php echo $_item->getCount() ?>)
</option>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:30:13+00:00Added an answer on June 11, 2026 at 6:30 am

    Try this code. It is tested in all the browsers.

    <select onchange="setLocation(this.value)">
    <?php $count = 0; ?>
     <?php foreach ($this->getItems() as $_item): ?> 
     <?php $count++; ?>
     <?php if($count == 1): ?>
    <option value='' disabled selected style='display:none;'>Choose <?php echo $attribute_code = $_item->getFilter()->getName();?> </option> 
    <?php endif; ?>
    <option <?php if ($_item->getCount() > 0): ?> value="<?php echo $this->urlEscape($_item->getUrl()) ?>">
    <?php echo $_item->getLabel() ?> <?php else: echo '>' . $_item->getLabel() ?> <?php endif; ?> (<?php echo $_item->getCount() ?>) </option>
    <?php endforeach; ?> 
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a group of dropdowns using knockout out that allow
Using MVC3 with NHibernate, I am having a problem with dropdowns. I have a
I am getting this error. I am using ICallbackEventHandler to fill the some dropdowns.
Hi i am using dropdown for display the timezone.The timezone values are come from
I'm trying to get a suckerfish style dropdown menu to work in IE6 using
I have a site that is using jQuery UI to display forms located on
I have to display three dropdowns next to the date field for hour/minutes/am pm.
I'm using CakePHP 2.0. Is it possible to display multiple fields in select/dropdown box
I'm trying to implement chained filter dropdown using just javascript - jquery. The solution
I'm trying to create the illusion of a multiselect dropdown using a div that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.