/* ============================================================ PCBoost — EU arrival dates (add to the EU Shipping Gate snippet, or paste as its own snippet — it only needs pcb_cart_has_extended_dispatch() which already lives in the EU Shipping Gate snippet). When the cart contains an Extended…Continue reading
/* PCBoost — EU Shipping Gate Hides Express Next Day + Fast Delivery when the cart contains any item on the ‘extended-dispatch’ shipping class (5–7 day EU stock). */ function pcb_cart_has_extended_dispatch() { if ( ! WC()->cart ) { return false;…Continue reading
/* ============================================================ PCBoost Twin Merge v2.5 (WPCode snippet — PHP, Run Everywhere) v2.2 changes on top of v2.1: • Keeps the ‘extended-dispatch’ shipping class in sync with the active tier (set when active source is eu-5-7, cleared when next-day) —…Continue reading
/* ============================================================ PCBoost — Collapse optional UPS component behind a toggle (WPCode PHP snippet, or add to functions.php) Targets the Power Protection (UPS) component by its component_id (1780838418) so it doesn’t affect the drive/installation selectors. On the product page the…Continue reading
/* ============================================================ PCBoost — Sticky bottom Add-to-Cart bar (product pages) Appears when the real Add-to-basket button scrolls out of view; hides when it’s back in view. Simple products: the sticky button clicks the REAL button (respects qty/AJAX). Composite kits: the…Continue reading
if ( ! defined( ‘ABSPATH’ ) ) { exit; } add_action( ‘wp_footer’, function () { if ( ! function_exists( ‘is_product’ ) || ! is_product() ) return; ?>Continue reading
/** * PCBoost — contact form handler (no plugin). * Receives the form via admin-ajax (cache-immune) and emails [email protected]. * WPCode: PHP Snippet, Location = Run Everywhere. Or functions.php. */ add_action( ‘wp_ajax_pcb_contact’, ‘pcb_contact_handler’ ); add_action( ‘wp_ajax_nopriv_pcb_contact’, ‘pcb_contact_handler’ ); function pcb_contact_handler()…Continue reading
/* PCBoost – Related products: in-stock only (v2, replaces 186358) */ /* 1. Query level: the candidate pool is built only from in-stock products */ add_filter( ‘woocommerce_product_related_posts_query’, ‘pcb_related_instock_query’, 20, 2 ); function pcb_related_instock_query( $query, $product_id ) { global $wpdb; $lookup…Continue reading
// Trustpilot BCC on completed-order email (review invitations) add_filter(‘woocommerce_email_headers’, function($headers, $email_id, $order) { if ($email_id === ‘customer_completed_order’) { $headers .= ‘Bcc: [email protected]’ . “\r\n”; } return $headers; }, 10, 3); // Trustpilot review widget on product pages (light theme for…Continue reading
add_action( ‘wp_ajax_nopriv_pcb_business_apply’, ‘pcb_business_apply_handler’ ); add_action( ‘wp_ajax_pcb_business_apply’, ‘pcb_business_apply_handler’ ); function pcb_business_apply_handler() { // Honeypot: hidden “website” field must be empty if ( ! empty( $_POST[‘website’] ) ) { wp_send_json_success( array( ‘message’ => ‘Application received.’ ) ); } // Time-trap: form must…Continue reading