Add checks and explicit errors when cart buttons are missing data
to help debugging issues with other extensions manipulating WC Core add & remove from cart buttons or events.
Remove all product ids document.querySelectorAll('[data-product_id]').forEach((e)=>e.removeAttribute('data-product_id')). 8. Remove item from mini cart using UI
Check for errors in the console
Smoke test not tempered events and buttons for adding to & removing from cart, for regression
Additional details:
Changelog entry
Tweak - Add checks and explicit errors when cart buttons are missing data.
Changes proposed in this Pull Request:
Add checks and explicit errors when cart buttons are missing data to help debugging issues with other extensions manipulating WC Core add & remove from cart buttons or events.
This would help identifying issues like the one reported at https://wordpress.org/support/topic/js-error-on-add-to-cart-when-logged-out/
Checks:
Screenshots:
Detailed test instructions:
document.querySelectorAll('[data-product_id]').forEach((e)=>e.removeAttribute('data-product_id'))
. 8. Remove item from mini cart using UIAdditional details:
Changelog entry