/** * Add custom text to the Completed Order email for non-wholesale customers only. */ add_action( ‘woocommerce_email_before_order_table’, function( $order, $sent_to_admin, $plain_text, $email ) { // Only target the Completed Order email if ( ‘customer_completed_order’ !== $email->id ) { return; }…Continue reading
/** * Set featured image from the first /uploads/ image found in post content * for posts that do not already have a valid featured image. * * Usage: * Run batch: * /wp-admin/?idxc_run_featured_image_fix_batch=1&batch_size=50 * * Reset checked flag: *…Continue reading
add_action(‘template_redirect’, function () { if (is_admin()) return; global $wp; $request_path = trim($wp->request, ‘/’); // Skip if already under /stories/ if (strpos($request_path, ‘stories/’) === 0) return; // Only run on 404s (old URLs) if (is_404()) { // Extract slug (last part…Continue reading
function dance_search_shortcode() { global $wpdb; // 🔧 CHANGE THIS $table = $wpdb->prefix . ‘nwdances’; // Detect admin for debug output $is_admin_user = current_user_can(‘manage_options’); ob_start(); echo ‘ ‘; echo ‘‘; echo ‘Search‘; echo ‘ ‘; // Default to empty string (shows…Continue reading
/** * Customize the Subject for wholesalers */ add_filter( ‘woocommerce_email_subject_customer_completed_order’, function( $subject, $order ) { if ( ! $order ) return $subject; $customer_id = $order->get_customer_id(); if ( ! $customer_id ) return $subject; $wholesale_roles = [ ‘wholesale_customer’, ‘wholesale_vip’ ]; $user =…Continue reading
/** * Add custom text to the Completed Order email for wholesale customers only. */ add_action( ‘woocommerce_email_before_order_table’, function( $order, $sent_to_admin, $plain_text, $email ) { // Only target the Completed Order email if ( ‘customer_completed_order’ !== $email->id ) { return; }…Continue reading
/** * Exclude wholesale roles from receiving the PDF Invoice attachment in emails. * * Wholesale Suite roles on this site: * – wholesale_customer (Wholesale Customer) * – wholesale_vip (Wholesale VIP) * * Plugin: WooCommerce PDF Invoices & Packing Slips…Continue reading
/** * ============================================================ * COMPANY DASHBOARD ROUTING (CLEAN + UPDATED) * ============================================================ * URLs: * /{company-slug}/ → /dashboard/?c={company-slug} * /{company-slug}/admin/ → /company-admin/?c={company-slug}&admin=1 * /{company-slug}/login/ → /company-login/?c={company-slug} * * Dashboard page slug: “dashboard” * Admin page slug: “company-admin” * Login page…Continue reading
add_action( ‘woocommerce_before_add_to_cart_form’, ‘roaslink_gestion_premium_v11’, 15 ); function roaslink_gestion_premium_v11() { if ( ! function_exists( ‘is_product’ ) || ! is_product() ) return; global $post; if ( ! $post || ( $post->post_name !== ‘google_ads’ && ! has_term( ‘google_ads’, ‘product_cat’, $post->ID ) ) ) return;…Continue reading
// Cart total AJAX handler add_action(‘wp_ajax_get_cart_total’, ‘ajax_get_cart_total’); add_action(‘wp_ajax_nopriv_get_cart_total’, ‘ajax_get_cart_total’); function ajax_get_cart_total() { WC()->cart->calculate_totals(); $ex_vat_total = 0; $inc_vat_total = 0; foreach (WC()->cart->get_cart() as $cart_item) { $line_total = $cart_item[‘line_total’]; $line_tax = $cart_item[‘line_tax’]; $ex_vat_total += $line_total; $inc_vat_total += $line_total + $line_tax; } echo…Continue reading