Home Forums WoodMart support forum PHP warning in logs: Undefined array key “aria-describedby_text

PHP warning in logs: Undefined array key “aria-describedby_text

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #576334

    ecb21
    Participant

    We are seeing this PHP warning popping up every second or so in our logs. Can someone please take a look at it, thank you.

    Got error 'PHP message: PHP Warning: Undefined array key "aria-describedby_text" in /home/*****/*****/public_html/wp-content/themes/woodmart/woocommerce/loop/add-to-cart.php on line 41'

    #576444

    Hello,

    Please deactivate all the 3rd party plugins and activate only theme-required plugins on the site and then check the issue. I am sure your issue will be solved. Then Activate the 3rd party plugins one by one and check which plugin is creating the issue for you.

    Otherwise, if the issue still exists then keep the 3rd party plugins deactivated and let me know I will check and give you a possible solution. Also switch the child to parent theme.

    Best Regards.

    #584916

    Besir
    Participant

    Hello dears,
    We are seeing the same warnings ,

    This is because of the updated code of add-to-cart.php ,
    We disabled almost all plugins , kept only theme related and WPML plugins,

    I used the code below to print $args array content ,

    <?php echo print_r( $args); ?>

    there is no aria-describedby_text inside the array,

    
    Array
    (
    [quantity] => 1
    [class] => button product_type_simple add_to_cart_button ajax_add_to_cart
    [attributes] => Array
    (
    [data-product_id] => 17798
    [data-product_sku] => Test-SKU
    [aria-label] => Add to cart: “Test Item”
    [aria-describedby] =>
    [rel] => nofollow
    )
    )
    1
    

    I wonder what should be the content of “aria-describedby_text” ?

    #584994

    Hello,

    Maybe the problem is likely caused by custom code added to the child theme. Please review any custom code you have added to the child theme to identify and resolve the issue.

    Best Regards.

    #585021

    Besir
    Participant

    Hello Aizaz ,
    Thank you for your reply,

    I downloaded Woodmart files and searched all php files fot “aria-describedby_text” ,
    The only file containing this string is the “add-to-cart.php”,

    Then is searched PHP files for “aria-describedby” , and found it in “white-label.php” file
    Looks like this is related to “White Label”!

    Since we are not using White Label then I fixed the issue by copying the “add-to-cart.php” to child theme and remove the
    <?php echo esc_html( $args['aria-describedby_text'] ); ?> as a workaround till we find a solution.
    This might be useful for others who are facing same issue,

    Thanks and regards

    • This reply was modified 1 month, 2 weeks ago by Besir.
    • This reply was modified 1 month, 2 weeks ago by Besir.
    #585074

    Hello,

    Glad to hear your issue has been resolved and thanks for sharing the solution. Keep us in mind for future questions and concerns, we’re always here to help!

    Best Regards,

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