Wholesale – No Discount Products

/** * Wholesale – No discount on tagged products * * Products tagged “no-discount” always sell at regular price * for wholesale users, regardless of role discount. * Supports simple products and variations. */ if ( ! function_exists( ‘upl_nd3_is_wholesale_user’ )…Continue reading

Wholesale – Catalog Weld Note (-weld roles)

/** * UNITED PRODUCTS – WHOLESALE CATALOG WELD NOTE * ——————————————— * Shows “Weld & dress added in cart” on archive/catalog/category pages * for logged-in wholesale users whose role contains “-weld”. * * Purpose: * – Gives weld-role customers context…Continue reading

Wholesale – Weld & dress cart fee (by blade width)

/** * Wholesale: Cart weld fee for -weld roles (grouped by blade width) — TAXABLE */ if ( ! function_exists(‘up_user_has_weld_role’) ) { function up_user_has_weld_role(): bool { if ( ! is_user_logged_in() ) return false; $user = wp_get_current_user(); foreach ( (array) $user->roles…Continue reading

Hero LCP Image Priority (Front Page)

add_filter(‘wp_get_attachment_image_attributes’, function ($attr, $attachment, $size) { if ( ! is_front_page() ) return $attr; // Hero background image (ID 6598) if ( isset($attachment->ID) && (int) $attachment->ID === 6598 ) { $attr[‘loading’] = ‘eager’; $attr[‘fetchpriority’] = ‘high’; $attr[‘decoding’] = ‘async’; } return…Continue reading

Disable TT4 webfonts + preload

/** * Nuke TT4 / WP webfonts (Inter & Cardo) from the front end. */ // 1. Stop TT4’s own preload / font-face helper (safety, but not relied on). add_action( ‘after_setup_theme’, function () { remove_action( ‘wp_head’, ‘twentytwentyfour_preload_webfonts’ ); }, 20…Continue reading

WooCommerce Checkout Newsletter Opt-In

// Add opt-in checkbox at checkout (after billing fields) add_action(‘woocommerce_after_checkout_billing_form’, ‘upl_add_newsletter_opt_in_checkbox’, 10); function upl_add_newsletter_opt_in_checkbox($checkout) { woocommerce_form_field(‘subscribe_to_newsletter’, array( ‘type’ => ‘checkbox’, ‘class’ => array(‘form-row-wide’), ‘label’ => __(‘Yes, I want to subscribe to your newsletter’), ‘required’ => false, ), $checkout->get_value(‘subscribe_to_newsletter’)); } //…Continue reading