Title: Minor visual bug with &#8220;Clear&#8221; functionality
Last modified: June 19, 2023

---

# Minor visual bug with “Clear” functionality

 *  Resolved [bellasera](https://wordpress.org/support/users/bellasera/)
 * (@bellasera)
 * [3 years ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/)
 * Wonderful plugin. Thank you very much for creating and sharing it!
 * I wanted to report a minor bug with the “Clear” functionality. When an item is
   out of stock, the swatch is blurred and crossed, as expected. But, if you click
   on a different swatch, then click the “Clear” button, it re-enables the out of
   stock swatch (removes the blur and cross).
 * The item is still marked out of stock and doesn’t allow you to add to cart, so
   it is a visual bug only.

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

 *  Plugin Support [Aamir](https://wordpress.org/support/users/aamiribsf/)
 * (@aamiribsf)
 * [3 years ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/#post-16832108)
 * Hello [@bellasera](https://wordpress.org/support/users/bellasera/) ,
   Greetings
   for the day!
 * Thank you for your kind and encouraging words. Your appreciation is greatly valued.
 * Regarding the issue you mentioned, I have successfully reproduced it. I will 
   escalate this matter to our team for further investigation and ensure that it
   is addressed and resolved in the upcoming update.
 * We truly appreciate you bringing this to our attention.
 * Wishing you a fantastic day ahead!
 * Best regards,
 *  [artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/)
 * (@artjommaierbrhv)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/#post-16866891)
 * Hi Aamir,
 * Is there a way to disable the “clear” button completely?
 * Rgds, Artjom
    -  This reply was modified 2 years, 11 months ago by [artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/).
 *  Plugin Support [Aamir](https://wordpress.org/support/users/aamiribsf/)
 * (@aamiribsf)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/#post-16867477)
 * Hello [@artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/),
   
   Thanks for writing back.
 * Regarding the “clear” variation option that is added by default through WooCommerce,
   we do not have the option to disable it. However, I can assist you in hiding 
   the clear button so that it won’t be visible and prevent users from clearing 
   the variation.
 * To achieve this, you can utilize custom CSS with the following code:
 *     ```wp-block-code
       .woocommerce div.product form.cart .reset_variations  
       {
         display:none;
       }
       ```
   
 * If you’re not sure how to use this custom CSS, please refer to the following 
   article on our knowledge base:
 * [How and Where to Add the Custom JS, CSS & PHP Codes?](https://cartflows.com/docs/add-custom-codes/)
 * Hope this helps.
 * Let me know how it goes.
    -  This reply was modified 2 years, 11 months ago by [Aamir](https://wordpress.org/support/users/aamiribsf/).
 *  [artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/)
 * (@artjommaierbrhv)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/#post-16869825)
 * Hi Aamir,
 * Thank you for your quick response.
 * I used below php-code to set a variation as default:
 *     ```wp-block-code
       add_filter( 'woocommerce_dropdown_variation_attribute_options_html', 'filter_dropdown_option_html', 12, 2 );
       function filter_dropdown_option_html( $html, $args ) {
           $show_option_none_text = $args['show_option_none'] ? $args['show_option_none'] : __( 'Choose an option', 'woocommerce' );
           $show_option_none_html = '<option value="">' . esc_html( $show_option_none_text ) . '</option>';
   
           $html = str_replace($show_option_none_html, '', $html);
   
           return $html;
       }
       ```
   
 * And This php-code to disable the “clear” button:
 *     ```wp-block-code
       add_filter( 'woocommerce_reset_variations_link', '__return_empty_string', 9999 );
       ```
   
 * The only Problem that I still have is:
 * When I click on different variation swatches, the height below changes (where
   usually the ‘clear’ button is). I also haven’t figured out how to disable it.
 * Rgds,
 * Artjom
    -  This reply was modified 2 years, 11 months ago by [artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/).
    -  This reply was modified 2 years, 11 months ago by [artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/).
    -  This reply was modified 2 years, 11 months ago by [artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/).
    -  This reply was modified 2 years, 11 months ago by [artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/).
 *  Plugin Support [Sravan Bhaskaravajjula](https://wordpress.org/support/users/bhshravankumar/)
 * (@bhshravankumar)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/#post-16884213)
 * Hello [@artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/),
 * I will test this code and contact our developers and update you on our findings.
 * Best,
 *  [artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/)
 * (@artjommaierbrhv)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/#post-16884721)
 * Thank you [@bhshravankumar](https://wordpress.org/support/users/bhshravankumar/)
 * Rgds, Artjom
 *  Plugin Support [Sravan Bhaskaravajjula](https://wordpress.org/support/users/bhshravankumar/)
 * (@bhshravankumar)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/#post-16898596)
 * Hello [@artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/),
 * I have added the filtercode but the extra space you mentioned is not showing 
   on my test website, ref: [https://d.pr/v/XMPkBU](https://d.pr/v/XMPkBU). I have
   Astra theme enabled on my test website.
 * Please share the theme you are using and the product page URL with us to look
   into this.
 * Best,
 *  [artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/)
 * (@artjommaierbrhv)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/#post-16898962)
 * Hi [@bhshravankumar](https://wordpress.org/support/users/bhshravankumar/) ,
 * I have found out why this is so. At woocommerce there is a function that shows
   how many remaining products are over, there is something like: “only 2 left”.
   I had initially hidden that as well (with I think javascript), which is why it
   made that move down and took distance for the text (which was hidden). Long story
   short, this was not due to the Variation Swatches plugin.
   Thank you very much
   for the feedback and your effort!
 * Kind rgds,
 * Artjom
 *  Plugin Support [Sravan Bhaskaravajjula](https://wordpress.org/support/users/bhshravankumar/)
 * (@bhshravankumar)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/#post-16899130)
 * Hello [@artjommaierbrhv](https://wordpress.org/support/users/artjommaierbrhv/),
 * Thanks for the update, happy to know the issue is resolved.
 * If you have any further questions, you can start a new thread.
   Thank you!

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

The topic ‘Minor visual bug with “Clear” functionality’ is closed to new replies.

 * ![](https://ps.w.org/variation-swatches-woo/assets/icon.svg?rev=2850895)
 * [Variation Swatches for WooCommerce – Color, Image & Size Swatches](https://wordpress.org/plugins/variation-swatches-woo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/variation-swatches-woo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/variation-swatches-woo/)
 * [Active Topics](https://wordpress.org/support/plugin/variation-swatches-woo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/variation-swatches-woo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/variation-swatches-woo/reviews/)

 * 9 replies
 * 4 participants
 * Last reply from: [Sravan Bhaskaravajjula](https://wordpress.org/support/users/bhshravankumar/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/minor-visual-bug-with-clear-functionality/#post-16899130)
 * Status: resolved