Redirect Desktop URLs on Mobile

// 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

Single product – Maattabel

// 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’]; // Voeg eventueel meer varianten…Continue reading

Global – Webwinkelkeur

// 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

Single product – Custom stock melding

// 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

Single product – Exclude attributes van tab

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

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

Global – Winkelmededeling

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

Single product – Variable price

// functions.php (child theme) of via Code Snippets add_action( ‘wp_head’, function () { if ( is_product() ) { echo ‘ ‘; } }); // 1) Toon ALTIJD de variatieprijs, ook als die gelijk is aan de parent-prijs add_filter( ‘woocommerce_show_variation_price’, ‘__return_true’…Continue reading

Gravity Forms – product list

// ============================================================================ // Gravity Forms: vul keuzelijst met producten en selecteer huidig product // Filters: gform_pre_render/admin_pre_render/pre_validation/pre_submission_filter // ============================================================================ add_filter( ‘gform_pre_render’, ‘populate_product_select_with_selected’ ); add_filter( ‘gform_admin_pre_render’, ‘populate_product_select_with_selected’ ); add_filter( ‘gform_pre_validation’, ‘populate_product_select_with_selected’ ); add_filter( ‘gform_pre_submission_filter’, ‘populate_product_select_with_selected’ ); function populate_product_select_with_selected( $form ) { if(…Continue reading