Home › Forums › WoodMart support forum › ERROR of “elements with non-unique id”
ERROR of “elements with non-unique id”
- This topic has 7 replies, 2 voices, and was last updated 1 year, 4 months ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
July 7, 2025 at 4:35 pm #672226
vctxiaoParticipantHi Friends,
I have got some errors of “elements with non-unique id “,
Please see attached screen shot.
I’d like to know why this appeared and how to fix it?
Thanks.Attachments:
You must be logged in to view attached files.July 8, 2025 at 9:03 am #672352Hello,
Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.
Best Regards,
July 8, 2025 at 11:04 am #672383
vctxiaoParticipantHi,
That could be not my site’s issue, it’s the your theme’s programming bug. The woodmart \woocommerce\add to cart \variable.php, php echo esc_attr( sanitize_title( $attribute_name ), for the reason of ID duplication, so the explore console warning. When I use my own codesnippet —-
add_filter( ‘woocommerce_dropdown_variation_attribute_options_args’, function( $args ) {
if ( isset( $args[‘attribute’] ) && isset( $args[‘product’] ) ) {
static $count = 0;
$count++;给 select 元素生成唯一id:属性名_产品ID_计数
$args[‘id’] = $args[‘attribute’] . ‘_’ . $args[‘product’]-get_id() . ‘_’ . $count;
}
return $args;
});
The explore warning disappeared. But this code will disable the AJAX action of add to cart button.
It’s a complicated problem for your theme, it’s believed I’m not the first guy to report this issue. The theme needs an update. That’s my point.July 8, 2025 at 2:07 pm #672446Hello,
I’ve double-checked this on our test site using the latest version of the WoodMart theme, and I’m not seeing any console warnings related to this: https://postimg.cc/RW3VTWRg
It’s possible that the warning on your site may be influenced by a customization or third-party plugin.
Best Regards,
July 8, 2025 at 3:34 pm #672491
vctxiaoParticipantOK, maybe you’re right, but I have tested it when I switch to woodmart father theme also disable my child theme, same issue. Please use my admin to check it, what’s the critical problem.
Thanks.July 9, 2025 at 12:00 pm #672639Hello,
We see the issue on our site, and we will fix it in our next update.
Thanks for your patience.
Best Regards,
July 9, 2025 at 5:37 pm #672745
vctxiaoParticipantOK,Thanks. Looking forward to your next update soon.
You can close this ticket now.July 10, 2025 at 9:33 am #672790Hello,
You’re very welcome! If you need anything else, feel free to reach out!
Thanks for contacting us.
Have a great day.Topic Closed.
Best Regards, -
AuthorPosts
The topic ‘ERROR of “elements with non-unique id”’ is closed to new replies.
- You must be logged in to create new topics. Login / Register