Single product – Hide title breadcrumbs
add_filter( ‘rank_math/frontend/breadcrumb/items’, function( $crumbs, $class ) { if(is_single()){ array_pop($crumbs); } return $crumbs; }, 10, 2);Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘rank_math/frontend/breadcrumb/items’, function( $crumbs, $class ) { if(is_single()){ array_pop($crumbs); } return $crumbs; }, 10, 2);Continue reading
// ============================================================================ // 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
add_filter( ‘woocommerce_product_get_attributes’, function( $attributes, $product ) { // Mogelijke kleur-attribuutnamen $color_keys = [ ‘pa_kleur’, ‘pa_color’ ]; // Zoek welke aanwezig is $found_key = null; foreach ( $color_keys as $key ) { if ( isset( $attributes[ $key ] ) ) {…Continue reading
add_filter( ‘manage_edit-product_columns’, ‘descriptions_product_column’, 10); add_filter( ‘manage_edit-product_sortable_columns’, ‘descriptions_product_sortable_column’, 10); add_action( ‘manage_product_posts_custom_column’, ‘descriptions_product_column_content’, 10, 2 ); function descriptions_product_column($columns){ $new_columns = []; foreach( $columns as $key => $column ){ $new_columns[$key] = $columns[$key]; if( $key == ‘price’ ) { $new_columns[‘short_description’] = ‘Korte omschrijving’; $new_columns[‘content’]…Continue reading
/** * Custom metaboxes voor WooCommerce producten */ add_action(‘add_meta_boxes’, function () { add_meta_box( ‘custom_metabox_highlighted_product’, ‘Uitgelicht product’, ‘highlighted_product_custom_metabox’, ‘product’, ‘normal’, ‘high’ ); add_meta_box( ‘custom_metabox_remarks’, ‘Beoordeling’, ‘product_remarks_custom_metabox’, ‘product’, ‘normal’, ‘high’ ); add_meta_box( ‘custom_metabox_video’, ‘Product video’, ‘product_video_custom_metabox’, ‘product’, ‘normal’, ‘high’ ); }); function…Continue reading
// Move single product title remove_action(‘woocommerce_single_product_summary’, ‘woocommerce_template_single_title’, 5); add_action(‘woocommerce_before_single_product_summary’, ‘woocommerce_template_single_title’, 10); // Verplaats alleen de rating (sterren + “(x klantbeoordelingen)”) remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_rating’, 10 ); add_action( ‘woocommerce_before_single_product_summary’, ‘woocommerce_template_single_rating’, 12 ); // Verplaats productprijs voor álle producttypes add_action(‘woocommerce_single_product_summary’, ‘custom_move_product_price’, 1); function…Continue reading
// Add SKU under title add_action(‘woocommerce_single_product_summary’, ‘plaats_sku_onder_titel’, 11); function plaats_sku_onder_titel() { global $product; if ( $product->get_sku() ) { echo ‘ ‘ . esc_html__( ‘Referentie:’, ‘Woocommerce’ ) . ‘ ‘ . esc_html( $product->get_sku() ) . ‘ ‘; } }Continue reading
// Bereken kortingspercentages function my_get_discount_percentages( $product ) { $percentages = []; if ( $product->is_type( ‘variable’ ) ) { $prices = $product->get_variation_prices( true ); foreach ( $prices[‘regular_price’] as $key_id => $regular_price ) { $sale_price = $prices[‘price’][ $key_id ]; if ( $regular_price…Continue reading
// Shortcode: [spaar_bedrag] function shortcode_spaar_bedrag() { if ( ! is_product() ) { return ”; } global $product; if ( ! $product instanceof WC_Product ) { return ”; } // Zorg dat je altijd een concrete prijs hebt (ook bij variaties)…Continue reading
class PIM_Metaboxes { public function __construct() { add_action( ‘admin_init’, array($this, ‘add_metaboxes’) ); add_action( ‘save_post’, array($this, ‘save_metabox_data’), 10 , 3 ); add_action( ‘admin_enqueue_scripts’, array($this, ‘category_enqueue_scripts’) ); add_action(‘pa_brand_add_form_fields’, array($this, ‘add_pa_brand_fields’), 10, 2 ); add_action(‘pa_brand_edit_form_fields’, array($this, ‘edit_pa_brand_fields’), 10, 2 ); // Voor pa_merk…Continue reading