Title: Keep Dropdown box open
Last modified: April 17, 2019

---

# Keep Dropdown box open

 *  [anthonybuffo](https://wordpress.org/support/users/anthonybuffo/)
 * (@anthonybuffo)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/keep-dropdown-box-open/)
 * I want to keep the drop down option open so the user can see all the options 
   at once and make a selection to . I need to know the code to do this and where
   it goes.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fkeep-dropdown-box-open%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Habibillah](https://wordpress.org/support/users/habibillah/)
 * (@habibillah)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/keep-dropdown-box-open/#post-11441886)
 * See on faq at [How can I change the listbox and discount templates?](https://wordpress.org/plugins/woocommerce-fixed-quantity/)
    -  This reply was modified 6 years, 11 months ago by [Habibillah](https://wordpress.org/support/users/habibillah/).
 *  Thread Starter [anthonybuffo](https://wordpress.org/support/users/anthonybuffo/)
 * (@anthonybuffo)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/keep-dropdown-box-open/#post-11443151)
 * I saw that previously and it only tells me how to copy a directory and make changes.
   It doe snot tell me the code to keep the box open. Also when I create that new
   directory and make changes to the php in those new folders it doesn’t do anything.
   No change takes place unless I modify the php in the plugins directory.
 *  Plugin Author [Habibillah](https://wordpress.org/support/users/habibillah/)
 * (@habibillah)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/keep-dropdown-box-open/#post-11462663)
 * You are correct. that just point you to place where you need to change it. for
   example you can change the `<select>` into `<input type="radio">`
 *  Thread Starter [anthonybuffo](https://wordpress.org/support/users/anthonybuffo/)
 * (@anthonybuffo)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/keep-dropdown-box-open/#post-11466651)
 * Sorry I am not a coder. I need help with where to place this and what to write.
   I basically need the code. Or the code to keep the drop down open to display 
   all the options at one time.
 *  Thread Starter [anthonybuffo](https://wordpress.org/support/users/anthonybuffo/)
 * (@anthonybuffo)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/keep-dropdown-box-open/#post-11466744)
 * I also want to change the color of the “highlight/select”. How do I do that?
 *  Thread Starter [anthonybuffo](https://wordpress.org/support/users/anthonybuffo/)
 * (@anthonybuffo)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/keep-dropdown-box-open/#post-11482095)
 * I STILL need some guidance on this. I have put the <input type=”radio”> all over
   the place in the wp-content/plugins/woocommerce-fixed-quantity/templates/global/
   quantity-input.php file and nothing seems to work. I get buttons to appear (un-
   formatted) and I can click/select multiple buttons at once and nothing is truly
   selected at all. I am obviously missing code and there is more to this than what
   you gave me in your intinal response to my problem.
 * Again, if radio buttons are too difficult how can I just keep the entire drop
   box open to display all the options and where do I change the “selection” color
   which is currently blue.
 *  Plugin Author [Habibillah](https://wordpress.org/support/users/habibillah/)
 * (@habibillah)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/keep-dropdown-box-open/#post-11485334)
 * I think you need get someone help you. try to get it on freelancer or upwork
 *  [Mark Krieger](https://wordpress.org/support/users/markcanada/)
 * (@markcanada)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/keep-dropdown-box-open/#post-11647161)
 * I changed ‘[yourtheme]/woocommerce-fixed-quantity/global/quantity-input.php’ 
   as per the above link to the code below.
    It shows radio buttons on the product
   pages and still the dropdown in the cart to keep it a clean display (@habibillah–
   feel free to use the code with a setting to turn the radio buttons off/on in 
   your plugin):
 *     ```
       <?php
       /**
        * Product quantity inputs
        *
        * This template can be overrided by copying it to yourtheme/woocommerce-fixed-quantity/global/quantity-input.php
        *
        * @var string $input_name
        * @var WC_Product $product
        * @var int $selected_quantity
        */
       if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
   
       if (empty($product))
           global $product;
   
       $selected_quantity = !empty($selected_quantity)? $selected_quantity : '';
   
       $data = WoofixUtility::isFixedQtyPrice($product);
       ?>
       <div class="quantity_select">
   
           <?php
           if (!is_cart()) {
               do_action('woofix_before_quantity_input');
           }
   
           if (!is_cart()) {
               ?><div id="fq_qty_radio">
               <?php foreach ($data['woofix'] as $item): 
                   $woofix_price = $item['woofix_price'];
                   $woofix_qty = $item['woofix_qty'];
                   $woofix_disc = $item['woofix_disc'] . '%';
                   $price = wc_price($woofix_price);
                   $total = wc_price($woofix_price * $woofix_qty);
   
                   $woofix_desc = !empty($item['woofix_desc'])? $item['woofix_desc'] : WOOFIXCONF_QTY_DESC;
                   $description = str_replace(
                       array('{qty}', '{price}', '{total}', '{discount}', ' '),
                       array($woofix_qty,  $price, $total, $woofix_disc, '&nbsp;'),
                       $woofix_desc
                   );
                   if ( empty ( $selected_quantity )) $selected_quantity = $woofix_qty; ?>
   
                   <label for="<?php echo 'wqid.'.$woofix_qty; ?>"><input type="radio" name="<?php echo esc_attr( $input_name ); ?>" value="<?php echo $woofix_qty; ?>" id="<?php echo 'wqid.'.$woofix_qty; ?>" data-qty="<?php echo $woofix_qty; ?>" data-price="<?php echo $woofix_price; ?>" <?php echo ($selected_quantity == $woofix_qty)? "checked" : ""; ?>> <?php echo $description; ?></label><BR />
   
               <?php endforeach; ?>
               </div>
               <?php
           } else {
               ?>
   
               <select name="<?php echo esc_attr( $input_name ); ?>"
                       title="<?php _ex( 'Qty', 'Product quantity input tooltip', 'woofix' ); ?>"
                       class="qty">
                   <?php foreach ($data['woofix'] as $item): ?>
   
                       <?php
                       $woofix_price = $item['woofix_price'];
                       $woofix_qty = $item['woofix_qty'];
                       $woofix_disc = $item['woofix_disc'] . '%';
                       $price = wc_price($woofix_price);
                       $total = wc_price($woofix_price * $woofix_qty);
   
                       $woofix_desc = !empty($item['woofix_desc'])? $item['woofix_desc'] : WOOFIXCONF_QTY_DESC;
                       $description = str_replace(
                           array('{qty}', '{price}', '{total}', '{discount}', ' '),
                           array($woofix_qty,  $price, $total, $woofix_disc, '&nbsp;'),
                           $woofix_desc
                       );
                       ?>
   
                       <option value="<?php echo $woofix_qty; ?>"
                               data-qty="<?php echo $woofix_qty; ?>"
                               data-price="<?php echo $woofix_price; ?>" <?php echo ($selected_quantity == $woofix_qty)? "selected" : ""; ?>>
   
                           <?php echo $description; ?>
                       </option>
   
                   <?php endforeach; ?>
               </select>
   
               <?php
           }
   
           if (!is_cart()) {
               do_action('woofix_after_quantity_input');
           }
           ?>
   
       </div>
       ```
   

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Keep Dropdown box open’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-fixed-quantity_49484d.
   svg)
 * [WooCommerce Fixed Quantity](https://wordpress.org/plugins/woocommerce-fixed-quantity/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-fixed-quantity/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-fixed-quantity/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-fixed-quantity/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-fixed-quantity/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-fixed-quantity/reviews/)

## Tags

 * [dropdown](https://wordpress.org/support/topic-tag/dropdown/)
 * [list](https://wordpress.org/support/topic-tag/list/)
 * [radio](https://wordpress.org/support/topic-tag/radio/)

 * 8 replies
 * 3 participants
 * Last reply from: [Mark Krieger](https://wordpress.org/support/users/markcanada/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/keep-dropdown-box-open/#post-11647161)
 * Status: not resolved