add_to_cart button on product page detaild page – ajax add to cart
-
Please, consider changing the behavior of the add_to_cart button script on the product page.
wp-content/plugins/duracelltomi-google-tag-manager/js/gtm4wp-woocommerce.js
// track add to cart events for products on product detail pages (line 250)
from:
if ( event_target_element.closest( '.single_add_to_cart_button:not(.disabled)' ) ) {
to:
if ( event_target_element.closest( '.single_add_to_cart_button' ) ) {
Please, remove :not(.disabled)
This my occurs problems into shops using AJAX to adding product to cart.
Because after click on the button, woocommerce add class .disabled to button, and then IF statement rule will be FALSE, and script send dataLayer not fire.
- You must be logged in to reply to this topic.