// 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
//Remove all admin dashboard widgets add_action(‘wp_dashboard_setup’, ‘remove_all_dashboard_widgets’, 100 ); function remove_all_dashboard_widgets() { global $wp_meta_boxes; $wp_meta_boxes = []; } //Add custom ones add_action(‘wp_dashboard_setup’, ‘my_dashboard_widgets’, 999); function my_dashboard_widgets() { wp_add_dashboard_widget( ‘my_dashboard_widget’, // Widget slug ‘Uitleg Antilope webshops’, // Widget title ‘my_dashboard_widget_content’ //…Continue reading
// Toon totaal spaarbedrag op basis van winkelmand in (FunnelKit) checkout function shortcode_spaar_bedrag_checkout() { // Controleer of WooCommerce actief is if ( ! function_exists( ‘WC’ ) || ! WC()->cart ) { return ”; } // FunnelKit laadt niet altijd als…Continue reading
/** * 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
// Add merk logo to single product add_action(‘woocommerce_single_product_summary’, ‘toon_merk_logo_op_productpagina’, 5); function toon_merk_logo_op_productpagina() { global $product; $opening_tag = false; // Get SKU $product_number = $product->get_sku(); if ($product_number) { $opening_tag = true; // Let op: Alleen opening tag echo ‘ ‘; echo…Continue reading
add_action( ‘wp_footer’, ‘add_size_chart_near_swatches’ ); function add_size_chart_near_swatches() { if ( is_product() ) : $label_text = __( ‘Bekijk maattabel’, ‘woocommerce’ ); ?>Continue reading
function custom_woocommerce_attribute( $html, $attribute, $values ) { // Controleer of $attribute een object of string is if ( is_object( $attribute ) && method_exists( $attribute, ‘get_name’ ) ) { $attribute_name = strtolower( $attribute->get_name() ); } else { $attribute_name = strtolower( (string)…Continue reading
add_filter( ‘gform_required_legend’, ‘__return_empty_string’ );Continue reading
/** * Username Field * Description: Adds a username field to WC Vendors Signup and uses it when creating the user. */ defined( ‘ABSPATH’ ) || exit; add_filter( ‘wcv_signup_form_config’, function( $config ) { $config = is_array( $config ) ? $config…Continue reading