// 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
// Hide quantity on single product, except for Product Bundles function custom_remove_quantity_field_single( $return, $product ) { // Check if we are on a single product page if ( is_product() ) { // Controleer of het product een bundel is if…Continue reading
// Show plus/min description tab (zonder ACF, met standaard meta – robuust) add_filter(‘woocommerce_product_tabs’, ‘meta_plus_minpunten_boven_description’, 20); function meta_plus_minpunten_boven_description($tabs) { if (!is_product()) return $tabs; $theme_dir = get_stylesheet_directory_uri(); // voor svg-pad $product_id = get_the_ID(); // Haal meta op (kan string, array of genest…Continue reading
// This snippet ONLY runs on MOBILE devices. // It checks if the user is on a desktop page and sends them to the mobile version. add_action( ‘template_redirect’, function() { // — Define your page pairs — // ‘desktop_page_slug’ =>…Continue reading
// Maattabel popup op single product function toon_maattabel_popup_van_pa_merk_of_brand() { if ( ! is_product() ) { return; } $product_id = get_the_ID(); // Controleer eerst welke taxonomie beschikbaar is voor dit product $taxonomies = [‘pa_merk’, ‘pa_brand’, ‘pa_brands’, ‘pa_marke’]; // Voeg eventueel meer…Continue reading
// ACF Options page add_action(‘acf/init’, function() { if ( function_exists(‘acf_add_options_page’) ) { acf_add_options_page(array( ‘page_title’ => ‘Winkelinstellingen’, ‘menu_title’ => ‘Winkelinstellingen’, ‘menu_slug’ => ‘instellingen’, ‘capability’ => ‘edit_posts’, ‘redirect’ => true, )); } }); // ACF read only fields function wwk_acf_read_only_field( $field )…Continue reading
// Verberg availability/stock tekst voor variaties met ‘Toestaan, maar klant informeren’ add_filter( ‘woocommerce_get_availability_text’, function( $availability, $product ) { if ( $product && $product->is_type(‘variation’) ) { // toon geen availability tekst als backorders toegestaan zijn mét notificatie en het item op…Continue reading
function mycode_hide_attributes_from_additional_info_tabs( $attributes, $product ) { /** * Array of attributes to hide from the Additional Information * tab on single WooCommerce product pages. */ $hidden_attributes = [ ‘pa_kleur’, ‘pa_maat’, ‘pa_lengtemaat’, ‘pa_filter-color’, ‘pa_taillemaat’, ‘pa_merk’ ]; foreach ( $hidden_attributes as $hidden_attribute…Continue reading
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
add_action( ‘wp_body_open’, ‘toon_winkelmededeling_banner’ ); function toon_winkelmededeling_banner() { $tekst = get_field( ‘winkelmededeling_tekst’, ‘option’ ); $link = get_field( ‘winkelmededeling_link’, ‘option’ ); $start_datum = get_field( ‘winkelmededeling_start’, ‘option’ ); $start_tijd = get_field( ‘winkelmededeling_starttijd’, ‘option’ ); $eind_datum = get_field( ‘winkelmededeling_einde’, ‘option’ ); $eind_tijd = get_field(…Continue reading