Home › Forums › WoodMart support forum › Broken ARIA reference
Broken ARIA reference
- This topic has 11 replies, 2 voices, and was last updated 1 year ago by Luke Nielsen.
-
AuthorPosts
-
November 22, 2023 at 9:04 pm #514730
MrRedParticipantHi, 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–1November 23, 2023 at 11:34 am #514858
Luke NielsenKeymasterHello,
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
November 23, 2023 at 11:41 am #514862
MrRedParticipanthi here is the screenshot
November 23, 2023 at 3:55 pm #514961
Luke NielsenKeymasterHello,
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
November 23, 2023 at 4:01 pm #514964
MrRedParticipantJust chekced it with TwentyTwenty and i got no broken aria reference.
I only get it with your themeNovember 23, 2023 at 6:06 pm #515011
Luke NielsenKeymasterHello,
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
November 23, 2023 at 6:11 pm #515014
MrRedParticipantplease proceed, i have made a backup
November 24, 2023 at 12:08 pm #515204
MrRedParticipantAny news ?
November 24, 2023 at 3:08 pm #515287
Luke NielsenKeymasterHello,
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
November 24, 2023 at 3:18 pm #515289
MrRedParticipantCan you tell me where can i find this code part : https://prnt.sc/Rz1UXibmauXn
I need to edit the code to fix it.November 24, 2023 at 6:14 pm #515353
MrRedParticipantI 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();
});
});
});November 24, 2023 at 6:41 pm #515360
Luke NielsenKeymasterHello,
Glad that you found a solution.
Always remember that you can reach out to us with any questions you may have.
Kind Regards
-
AuthorPosts
The topic ‘Broken ARIA reference’ is closed to new replies.
- You must be logged in to create new topics. Login / Register