• Resolved zauroman

    (@zauroman)


    Hello! Please download the woodmart theme and test the “shop” page.

    1) If I choose a color and size from the store page, an error occurs in the console.

    2) If I change the page to the second, third, and so on (scroll through the products) using ajax without refreshing the page, the plugin does not see new products and does not record them in view_items_list.

    Screenshot

    https://ibb.co/R6dgK9N
    https://ibb.co/rynwpyQ

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter zauroman

    (@zauroman)

    I’m more interested in ajax page-by-page navigation.

    I can disable the add to cart field from the store page

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    Thej woodmart theme seems to be a premium theme, which I can’t download without purchasing. Can you plese tell me the URL of page of your site that you are having problems with?

    Thread Starter zauroman

    (@zauroman)

    I can point the URL somewhere in private messages

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    You can use the contact form: https://gtmkit.com/about/

    Thread Starter zauroman

    (@zauroman)

    ok

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    GTM Kit is using the officail WooCommerce hooks to add GTM data to the HTML. The Woodmart theme is not, but it may have its own hooks that you can use. If there is a hook you can add the GTM data with the following code:

    use TLA_Media\GTM_Kit\Integration\WooCommerce;
    
    function woodmart_gtmkit() {
    
    	add_action( '<<INSERT ACTION HOOK>>', [
    		WooCommerce::instance(),
    		'single_product_add_to_cart_tracking'
    	] );
    
    }
    
    if ( ! wp_installing() && ! wp_doing_ajax() && ! is_admin() ) {
    	add_action( 'plugins_loaded', 'woodmart_gtmkit' );
    }
    

    Try using the code in functions.php and remember to change <<INSERT ACTION HOOK>> with the relevant hook

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    I forgot to mention that the hook GTM Kit uses is ‘woocommerce_after_add_to_cart_button’

    Thread Starter zauroman

    (@zauroman)

    Tell me, this function should fix 2 problems at once? Unfortunately, I don’t understand the code and I don’t even know where to look for the hook.

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    The code should fix the problem with choosing color and size. I you don’t uderstand the code you should find a developer to implement it for you.

    Ajax scrolling is not support

    Thread Starter zauroman

    (@zauroman)

    Can you send me the code where the hook already stands ?

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    If you seach the WooCommerce code for do_action( 'woocommerce_after_add_to_cart_button' ); you will find:

    woocommerce/templates/singe-product/add-to-cart/external.php L. 29
    woocommerce/templates/singe-product/add-to-cart/grouped.php L. 122
    woocommerce/templates/singe-product/add-to-cart/simple.php L. 51
    woocommerce/templates/singe-product/add-to-cart/variation-add-to-cart-button.php L. 33

    Thread Starter zauroman

    (@zauroman)

    use TLA_Media\GTM_Kit\Integration\WooCommerce;
    
    function woodmart_gtmkit() {
    
    	add_action( '<<?????INSERT ACTION HOOK??????>>', [
    		WooCommerce::instance(),
    		'single_product_add_to_cart_tracking'
    	] );
    
    }
    
    if ( ! wp_installing() && ! wp_doing_ajax() && ! is_admin() ) {
    	add_action( 'plugins_loaded', 'woodmart_gtmkit' );
    }

    You misunderstood me. What do I need to insert here for the function to work?

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    You need to replace <<?????INSERT ACTION HOOK??????>>, which is normally iswoocommerce_after_add_to_cart_button, with the equivalent hook in Woodmart if there is one. If there isn’t a Woodmart hook you may not be able to add the GTM data without customizing the theme.

    Plugin Author Torben Lundsgaard

    (@torbenlundsgaard)

    Closing this as resolved

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘woodmart themes’ is closed to new replies.