-
-
Save tamarazuk/80b6920e8de169b6e021d19898a9cd68 to your computer and use it in GitHub Desktop.
Facebook for WooCommerce: Track AddToCart event on Basel theme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // only copy this line if needed | |
function sv_facebook_for_wc_basel_theme_add_filter_for_add_to_cart_fragments() { | |
// only make changes as long as Facebook for WooCommerce is installed | |
if ( function_exists( 'facebook_for_woocommerce' ) ) { | |
$events_tracker = facebook_for_woocommerce()->get_integration()->events_tracker; | |
$events_tracker->add_filter_for_conditional_add_to_cart_fragment(); | |
} | |
} | |
add_action( 'wp_ajax_nopriv_basel_ajax_add_to_cart', 'sv_facebook_for_wc_basel_theme_add_filter_for_add_to_cart_fragments' ); | |
add_action( 'wp_ajax_basel_ajax_add_to_cart', 'sv_facebook_for_wc_basel_theme_add_filter_for_add_to_cart_fragments' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment