/** * ============================================================================= * META PIXEL — InitiateCheckout (WooCommerce Checkout) * ============================================================================= * Fires on checkout page (not thank you). * Includes contents + value. * Adds a sessionStorage guard to reduce accidental duplicates. */ add_action(‘wp_footer’, ‘voelgoed_meta_pixel_initiate_checkout’, 20); function voelgoed_meta_pixel_initiate_checkout()…Continue reading
/** * ============================================================================= * META PIXEL — Purchase (WooCommerce Thank You) — Dedup ready for CAPI * ============================================================================= * – Fires on thank-you page ONLY for paid orders (processing/completed) * – Uses variation_id when present * – Adds eventID =…Continue reading
/** * ============================================================================= * META PIXEL — AddToCart * ============================================================================= * – Single product: fires on form submit (no jQuery required) * – Archives AJAX: listens to WooCommerce ‘added_to_cart’ (requires jQuery) * – Fallback: click listener on add_to_cart_button if jQuery…Continue reading
// Track ViewContent event on product pages add_action(‘wp_footer’, ‘voelgoed_meta_pixel_view_content’); function voelgoed_meta_pixel_view_content() { if (!function_exists(‘is_product’)) return; if (is_product()) { global $product; if (!$product) return; ?>Continue reading
/** * Auto-complete orders that contain ONLY virtual items, * but ONLY after payment is confirmed. * EXCLUDES EFT / Direct Bank Transfer (bacs). */ add_action( “woocommerce_payment_complete”, “vg_autocomplete_virtual_orders_after_payment”, 20 ); function vg_autocomplete_virtual_orders_after_payment( $order_id ) { if ( ! $order_id )…Continue reading
/** * Make Bricks product queries (Products element) respect * WooCommerce Wholesale Prices Premium product visibility. */ add_filter( ‘bricks/posts/query_vars’, function ( $query_vars, $settings, $element_id, $element_name ) { // Only affect product queries $post_type = $query_vars[‘post_type’] ?? null; $is_product_query = (…Continue reading
if (!function_exists(‘rd_wc_round_down_step’)) { function rd_wc_round_down_step(int $value, int $step): int { if ($stepContinue reading
if (!function_exists(‘rd_wc_customer_count_get’)) { function rd_wc_customer_count_get(array $args = array()): int { if (!function_exists(‘WC’)) { return 0; } global $wpdb; $defaults = array( ‘scope’ => ‘all’, ‘registered_only’ => false, ‘roles’ => array(‘customer’), ‘require_role’ => false, ); $args = array_merge($defaults, $args); $scope =…Continue reading