• Resolved bellasera

    (@bellasera)


    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

    (@aamiribsf)

    Hello @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,

    Hi Aamir,

    Is there a way to disable the “clear” button completely?

    Rgds, Artjom

    Plugin Support Aamir

    (@aamiribsf)

    Hello @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:

    .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?

    Hope this helps.

    Let me know how it goes.

    • This reply was modified 2 years, 11 months ago by Aamir.

    Hi Aamir,

    Thank you for your quick response.

    I used below php-code to set a variation as default:

    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:

    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

    Plugin Support Sravan Bhaskaravajjula

    (@bhshravankumar)

    Hello @artjommaierbrhv,

    I will test this code and contact our developers and update you on our findings.

    Best,

    Thank you @bhshravankumar

    Rgds, Artjom

    Plugin Support Sravan Bhaskaravajjula

    (@bhshravankumar)

    Hello @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. 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,

    Hi @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

    (@bhshravankumar)

    Hello @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.