Product category – Add-ons – USP bar

// Productcategorie banner add_action(‘generate_after_header’, ‘toon_extra_content_boven_productcategorie’, 11); function toon_extra_content_boven_productcategorie() { if (!is_product_category()) return; $term = get_queried_object(); if (!$term || !isset($term->term_id)) return; $extra_content = get_field(‘extra_content_optioneel’, ‘product_cat_’ . $term->term_id); $thumbnail = get_field(‘thumbnail’, ‘product_cat_’ . $term->term_id); if ($extra_content || $thumbnail) { echo ‘ ‘;…Continue reading

Product category – Reviews

add_filter( ‘woocommerce_product_get_rating_html’, function( $html, $rating, $count ) { if ( is_product() || ! $html ) { return $html; // alleen aanpassen op archiefpagina’s met sterren } global $product; if ( ! $product instanceof WC_Product ) { return $html; } $review_count…Continue reading

Product category – Shortcode for category image

/** * Shortcode: toon de thumbnail van de huidige WooCommerce productcategorie * * Gebruik: [category_thumbnail] */ function woocommerce_category_image_shortcode() { // Alleen uitvoeren op categorie-archieven if ( ! is_product_category() ) { return ”; // niets tonen buiten categoriepagina } global $wp_query;…Continue reading

Archive – Products – JS popup

document.addEventListener(‘DOMContentLoaded’, function () { const infoButtons = document.querySelectorAll(‘.facet-info-button’); const allPopups = document.querySelectorAll(‘.facet-popup’); let lastFocused = null; infoButtons.forEach(button => { button.addEventListener(‘click’, function () { const facet = this.dataset.facet; const popup = document.querySelector(`.facet-popup[data-facet=”${facet}”]`); const content = popup?.querySelector(‘.popup-content’); if (popup) { lastFocused =…Continue reading

Hide product categories

add_filter( ‘get_terms’, ‘ts_get_subcategory_terms’, 10, 3 ); function ts_get_subcategory_terms( $terms, $taxonomies, $args ) { $new_terms = array(); if ( in_array( ‘product_cat’, $taxonomies ) && ! is_admin() &&is_shop() ) { foreach( $terms as $key => $term ) { if ( !in_array( $term->slug,…Continue reading