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!

October 19, 2020

In JavaScript simple script for print specific part of website.

 



- You can easly print any part of webpage means any specific div using javascript,

- Please follow simple below steps for that:

e.g.:

HTML

    <div id="any_id_name">

      <p>Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book.</p>

     </div>

JavaScript

    <script type="text/javascript">

var prtContent = document.getElementById("any_id_name");

var WinPrint = window.open('', '', 'width=500,height=500,scrollbars=0,status=0');

WinPrint.document.write(prtContent.innerHTML);

WinPrint.document.close();

WinPrint.focus();

WinPrint.print();

WinPrint.close();

</script>

Note: Please change width and height as per your requirenment of popup size.

Enjoy!

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...