// ============================================================================ // 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’, ‘pa_farbe’ ]; // Zoek welke aanwezig is $found_key = null; foreach ( $color_keys as $key ) { if ( isset( $attributes[ $key ] ) )…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: 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_action( ‘wp_footer’, ‘add_size_chart_near_swatches’ ); function add_size_chart_near_swatches() { if ( is_product() ) : $label_text = __( ‘Bekijk maattabel’, ‘woocommerce’ ); ?>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
add_filter( ‘frm_api_request_args’, ‘my_custom_frm_api_request_header’, 10, 2 ); function my_custom_frm_api_request_header( $arg_array, $args ) { if ( $args[‘url’] == ‘https://api.brevo.com/v3/contacts/’ ) { // the full url where the request is being sent $arg_array[‘headers’][‘api-key’] = ‘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’; //Replace Your-API-Key-Here with your Brevo API key }…Continue reading
/** * Capture user login and add it as timestamp in user meta data * */ function user_last_login( $user_login, $user ) { update_user_meta( $user->ID, ‘last_login’, time() ); } add_action( ‘wp_login’, ‘user_last_login’, 10, 2 ); /** * Display last login time…Continue reading
define(‘MEMBER_REGISTRATION_FORM_KEY’, ‘member-registration’); define(‘MEMBER_REGISTRATION_FORM_ID’, FrmForm::get_id_by_key(MEMBER_REGISTRATION_FORM_KEY)); define(‘MEMBER_REGISTRATION_EMAIL_PRIMARY_FIELD_KEY’, MEMBER_REGISTRATION_FORM_KEY . ‘_email_primary’); define(‘MEMBER_REGISTRATION_EMAIL_PRIMARY_FIELD_ID’, FrmField::get_id_by_key(MEMBER_REGISTRATION_EMAIL_PRIMARY_FIELD_KEY)); define(‘MEMBER_REGISTRATION_EMAIL_SECONDARY_FIELD_KEY’, MEMBER_REGISTRATION_FORM_KEY . ‘_email_secondary’); define(‘MEMBER_REGISTRATION_EMAIL_SECONDARY_FIELD_ID’, FrmField::get_id_by_key(MEMBER_REGISTRATION_EMAIL_SECONDARY_FIELD_KEY)); define(‘MEMBER_REGISTRATION_USER_ID_FIELD_KEY’, MEMBER_REGISTRATION_FORM_KEY . ‘_user_id’); define(‘MEMBER_REGISTRATION_USER_ID_FIELD_ID’, FrmField::get_id_by_key(MEMBER_REGISTRATION_USER_ID_FIELD_KEY)); define(‘MEMBER_REGISTRATION_USER_NAME_FIELD_KEY’, MEMBER_REGISTRATION_FORM_KEY . ‘_user_name’); define(‘MEMBER_REGISTRATION_USER_NAME_FIELD_ID’, FrmField::get_id_by_key(MEMBER_REGISTRATION_USER_NAME_FIELD_KEY)); define(‘MEMBER_REGISTRATION_PASSWORD_FIELD_KEY’, MEMBER_REGISTRATION_FORM_KEY . ‘_password’); define(‘MEMBER_REGISTRATION_PASSWORD_FIELD_ID’, FrmField::get_id_by_key(MEMBER_REGISTRATION_PASSWORD_FIELD_KEY)); define(‘MEMBER_REGISTRATION_MEMBER_NAME_FIELD_KEY’, MEMBER_REGISTRATION_FORM_KEY . ‘_member_name_primary’); define(‘MEMBER_REGISTRATION_MEMBER_NAME_FIELD_ID’, FrmField::get_id_by_key(MEMBER_REGISTRATION_MEMBER_NAME_FIELD_KEY));…Continue reading