What Is The Difference? When people do work with us. Expect creative solutions, clear communication, and results tailored to your vision when working with us. Click here Creative Skills Unique designs crafted for your brand, engaging users with cutting-edge visuals Responsive Designs Delivering flawless experiences on every device, boosting user engagement and satisfaction. SEO Optimization Enhancing your online visibility with strategies that improve search engine rankings. Exceptional Support Offering committed support throughout and after project completion to guarantee client satisfaction. Quick Turnaround Consistently meeting deadlines and delivering dependable services without sacrificing quality or efficiency. Custom Solutions Designing custom websites tailored to your needs, improving functionality and user experience. What Is The Difference? When people don't work with us. Expect creative solutions, clear communication, and results tailored to your vision when working with us. Click here Creative Skills Unique designs crafted for your brand, engaging users with cutting-edge visuals Responsive Designs Delivering flawless experiences on every device, boosting user engagement and satisfaction. SEO Optimization Enhancing your online visibility with strategies that improve search engine rankings. Exceptional Support Offering committed support throughout and after project completion to guarantee client satisfaction. Quick Turnaround Consistently meeting deadlines and delivering dependable services without sacrificing quality or efficiency. Custom Solutions Designing custom websites tailored to your needs, improving functionality and user experience. /** * Woo Variation Radios + Auto Colour Swatches (reads term meta key: "color") * - Keeps the original (hidden via CSS) for Woo compatibility * - Adds radio UI after it * - Works for taxonomy attributes (pa_*) and custom attributes */ add_filter('woocommerce_dropdown_variation_attribute_options_html', 'ws_variation_radios_with_term_colors', 20, 2); function ws_variation_radios_with_term_colors($html, $args) { if ( empty($args['options']) || empty($args['product']) ) { return $html; } $product = $args['product']; $attribute = $args['attribute']; // e.g. "pa_colour" $name = !empty($args['name']) ? $args['name'] : 'attribute_' . sanitize_title($attribute); // Woo often passes selected in args; fallback to product default $selected = isset($args['selected']) ? (string) $args['selected'] : (string) $product->get_variation_default_attribute($attribute); // Prevent duplicates if a theme/plugin re-filters the same HTML multiple times if ( strpos($html, 'ws-var-radios') !== false ) { return $html; } $out = $html; // keep the select HTML (we will hide select in CSS) $out .= ''; foreach ( $args['options'] as $option ) { // IMPORTANT: // - For taxonomies: $option should be the term slug (what Woo expects) // - For custom attributes: $option is the raw string $value = (string) $option; $label = (string) $option; $hex = ''; // #rrggbb from term meta if ( taxonomy_exists($attribute) ) { $term = get_term_by('slug', $value, $attribute); if ( $term && !is_wp_error($term) ) { $label = $term->name; // Filter Builder v2 stores HEX here: $maybe = get_term_meta($term->term_id, 'color', true); // [oai_citation:1‡filter-builder-version-2.code-snippets.json](sediment://file_00000000ce9471f4b6d0aed74334a195) $maybe = is_string($maybe) ? trim($maybe) : ''; // Validate hex if ( preg_match('/^#([0-9a-f]{3}|[0-9a-f]{6})$/i', $maybe) ) { $hex = $maybe; } } } $checked = checked($selected, $value, false); $style = $hex ? ' style="--ws-swatch:' . esc_attr($hex) . ';"' : ''; $out .= ''; $out .= ''; $out .= ''; $out .= '' . esc_html(apply_filters('woocommerce_variation_option_name', $label)) . ''; $out .= ''; } $out .= ''; return $out; }