Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
jakebellacera / ICS.php
Last active July 26, 2024 07:48
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@TimBHowe
TimBHowe / facebook-for-woocommerce-overrides.php
Created January 31, 2018 13:53
Include this file or add this function to the functions.php file to fire the Facebook Pixel 'AddToCart' event on the 'woocommerce_after_cart' action.
<?php
// Add function to fix some for the event tracking issues from the facebook for WooCommerce 1.7.5 update.
add_action( 'woocommerce_init', 'wc_facebook_tracking_fixes' );
function wc_facebook_tracking_fixes(){
// Get the facebook integration class.
$facebook = WooCommerce::instance()->integrations->get_integrations()['facebookcommerce'];
// Add add to cart event tracking to allow for WooCommerce redirect to cart after adding product.
add_action('woocommerce_after_cart', array($facebook->events_tracker, 'inject_add_to_cart_event'));
}