Showing posts with label Woocommerce. Show all posts
Showing posts with label Woocommerce. Show all posts

October 22, 2020

Woocommerce: checkout form remove label and add placeholder

 

checkout form remove label and add placeholder


- Woocommerce allow you to remove any property of $field->property by using unset,

- Reference can be here: Customizing checkout fields using actions and filters,

- Here simple example of checkout form remove label and add placeholder,


e.g:

add_filter('woocommerce_checkout_fields','wc_checkout_fields_remove_callback');

function wc_checkout_fields_remove_callback($fields) {

    foreach ($fields as $cat => $value) {

        foreach ($fields[$cat] as $field => $prop) {

            unset($fields[$cat][$field]['label']);

        }

    }

   return $fields;

}


Enjoy!

The Future of Technology: Emerging Trends to Watch in 2025

Introduction As we navigate through 2025, the technological landscape continues to evolve at an unprecedented pace. Innovations that once se...