Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author PieterC

    (@siteoptimo)

    Hi phoeresten,

    Your WordPress template is probably hiding the labels at checkout. What template are you using?
    Please inform your template builder that this is a bad practice.

    Regards,

    Pieter

    Thread Starter phoeresten

    (@phoeresten)

    Hi Pieter,

    I’m using Bridge theme made by Qode

    Thank you,

    James

    Plugin Author PieterC

    (@siteoptimo)

    Hello James,

    Koen here. It appears as though your theme hides the WooCommerce labels and sets them as placeholders (the text inside the input fields).

    The “where did you hear about us” field is a dropdown, so it doesn’t have a placeholder (just like the country selector).

    What you could do in your case is adjust the value of the first option (– Choose an option –) to something that better reflects the purpose of the field. Place this in your theme’s functions.php:

    /**
     * Adjusts the value of the "empty" argument when preparing the WooCommerce Hear About Us select field.
     *
     * @param array $args
     * @param string $key
     *
     * @return array
     */
    function adjust_wchau_source_empty( $args, $key ) {
    	if ( $key === 'wchau_source' && $args['type'] === 'select' ) {
    		// Replace the "empty" option.
    		$args['options']['empty'] = __( 'Where did you hear about us?', 'your-textdomain' );
    	}
    
    	return $args;
    }
    
    // Add filter.
    add_filter( 'woocommerce_form_field_args', 'adjust_wchau_source_empty', 10, 2 );

    Hope this solves your problem.

    Koen

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Title/label not showing above drop down.’ is closed to new replies.