if ( ! defined( ‘ABSPATH’ ) ) { exit; } if ( class_exists( ‘WooCommerce’ ) ) { add_action( ‘woocommerce_coupon_options’, ‘rd_wc_add_hide_coupon_code_field’, 10, 2 ); function rd_wc_add_hide_coupon_code_field( $coupon_id, $coupon ) { woocommerce_wp_checkbox( array( ‘id’ => ‘_rd_hide_coupon_code_public’, ‘label’ => __( ‘Hide coupon code’,…Continue reading
// == Voelgoed Auto-Click Seating Map Button == // Priority: Vanilla JS -> jQuery (fallback) // Always ensures button is clicked once it appears, regardless of timing. (function() { var MAX_ATTEMPTS = 20; // Limit retries to avoid performance issues…Continue reading
// Track InitiateCheckout event on checkout page add_action( ‘wp_footer’, ‘voelgoed_meta_pixel_initiate_checkout’, 20 ); function voelgoed_meta_pixel_initiate_checkout() { // Safety: don’t run in admin or during AJAX calls if ( is_admin() || wp_doing_ajax() ) { return; } // Must be checkout page if…Continue reading
// Track WooCommerce Purchase event with Meta Pixel add_action(‘woocommerce_thankyou’, ‘voelgoed_meta_pixel_purchase’, 10, 1); function voelgoed_meta_pixel_purchase($order_id) { if (!$order_id) return; $order = wc_get_order($order_id); if (!$order) return; // Prevent duplicate tracking on page refresh if (get_post_meta($order_id, ‘_meta_pixel_tracked’, true)) return; // Build content_ids array…Continue reading
// Track AddToCart event with Meta Pixel add_action(‘wp_footer’, ‘voelgoed_meta_pixel_add_to_cart’); function voelgoed_meta_pixel_add_to_cart() { if (!function_exists(‘is_product’)) return; // Only on product pages if (!is_product()) return; global $product; if (!$product) return; ?>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