Home Forums WoodMart support forum Broken ARIA reference

Broken ARIA reference

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #514730

    MrRed
    Participant

    Hi, i get a lot of Broken ARIA reference in my home page.
    Also in empty categories the search icon looks like this : https://prnt.sc/4dAQi5Pof–1

    #514858

    Luke Nielsen
    Keymaster

    Hello,

    Please send me a screenshot with the errors of the Broken ARIA reference.

    As for the search, this custom code affects it so you can hide it and recheck the issue: https://take.ms/9ZIZs

    I await your response.

    Kind Regards

    #514862

    MrRed
    Participant

    hi here is the screenshot

    #514961

    Luke Nielsen
    Keymaster

    Hello,

    Thank you for the screenshot. Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?

    Kind Regards

    #514964

    MrRed
    Participant

    Just chekced it with TwentyTwenty and i got no broken aria reference.
    I only get it with your theme

    #515011

    Luke Nielsen
    Keymaster

    Hello,

    Please, confirm the permission for plugins deactivation, and switching to the parent/default theme. As soon as we complete the testing we will enable it all back, however, You would better make the full backup of your site.

    Also, please clarify which tool you use for checking the website.

    Kind Regards

    #515014

    MrRed
    Participant

    please proceed, i have made a backup

    #515204

    MrRed
    Participant

    Any news ?

    #515287

    Luke Nielsen
    Keymaster

    Hello,

    I have checked it with the default WooCommerce Storefront theme and there is the same issue: https://monosnap.com/file/M4ObdW5D3iDXtyOV1xXegE2Nny8rl0

    So it is not something caused by our theme because on the default theme the issue persists.

    Kind Regards

    #515289

    MrRed
    Participant

    Can you tell me where can i find this code part : https://prnt.sc/Rz1UXibmauXn
    I need to edit the code to fix it.

    #515353

    MrRed
    Participant

    I fixed it.

    I will live here the solution for anyone else with the same problem :

    Go to Theme File Editor -> Select ‘functions.php’ and add the following code :
    add_filter(‘woocommerce_product_add_to_cart_aria_describedby’, ‘custom_product_add_to_cart_aria_describedby’, 10, 2);

    function custom_product_add_to_cart_aria_describedby($description, $product) {
    // Customize the description based on your needs.
    // You can use data from $product to make it dynamic.
    return ‘Custom description for ARIA’;
    }

    function enqueue_custom_script() {
    wp_enqueue_script(‘custom-script’, get_stylesheet_directory_uri() . ‘/js/custom-script.js’, array(‘jquery’), ‘1.0’, true);
    }
    add_action(‘wp_enqueue_scripts’, ‘enqueue_custom_script’);

    Next create a folder named ‘js’ inside the woodmart-child folder
    Create a new js file ‘custom-script.js’ and add the following code :

    jQuery(document).ready(function($) {
    $(‘.wd-add-btn-replace .button.add_to_cart_button’).each(function() {
    var productId = $(this).data(‘product_id’);
    var variantOptionsDiv = $(‘<div id=”variant-options-‘ + productId + ‘”>This product has multiple variants. The options may be chosen on the product page.</div>’).css(‘display’, ‘none’);
    $(this).after(variantOptionsDiv);

    $(this).attr(‘aria-describedby’, ‘variant-options-‘ + productId);

    $(this).on(‘click’, function(e) {
    e.preventDefault();
    variantOptionsDiv.toggle();
    });
    });
    });

    #515360

    Luke Nielsen
    Keymaster

    Hello,

    Glad that you found a solution.

    Always remember that you can reach out to us with any questions you may have.

    Kind Regards

Viewing 12 posts - 1 through 12 (of 12 total)

The topic ‘Broken ARIA reference’ is closed to new replies.