Disable Billing Address

1 year ago

< 1 min read

Posted by:

Focus

Subscribe to newsletter

By subscribing you agree to with our Privacy Policy.

Share

Simplify checkout for virtual products or order via WhatsApp. Add this code in function.php.

CODE PHP

/**
 * @snippet Simplify Checkout if Only Virtual Products
*/

add_filter( 'woocommerce_checkout_fields' , 'njengah_simplify_checkout_virtual' );

function njengah_simplify_checkout_virtual( $fields ) {

   $only_virtual = true;

   foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {

      // Check if there are non-virtual products
      if ( ! $cart_item['data']->is_virtual() ) $only_virtual = false;
   }

    if( $only_virtual ) {

       unset($fields['billing']['billing_company']);

       unset($fields['billing']['billing_address_1']);

       unset($fields['billing']['billing_address_2']);

       unset($fields['billing']['billing_city']);

       unset($fields['billing']['billing_postcode']);

       unset($fields['billing']['billing_country']);

       unset($fields['billing']['billing_state']);

       unset($fields['billing']['billing_phone']);

       add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );

     }
     return $fields;

}

Read more

Global

3 min read

Improve the Quality of the Scrolling Experience with Custom CSS Scrollbars

Hello guys! Have you ever thought about how to improve the appearance of the scrollbar on your website page? A good scrollbar

Read more

Video

< 1 min read

How to Get Youtube API and Check Quotas

How to get Youtube API:Go to: https://console.cloud.google.com/apis/dashboard How to check Youtube API Quota:Go to: https://console.cloud.google.com/iam-admin/quotas

Read more

Breakpoints

< 1 min read

CSS Media Rule Based on Screen Sizes

This is very helpful for limiting custom CSS to certain breakpoints. Usage examples are Scrollbar, Offset Slides and Offset Carousel

Read more

Single Post

2 min read

Hiding “Previous Post” Navigation in Elementor with Custom CSS

Hi, there! I’ll share some quick tips on how to change the appearance of article navigation on your Elementor website.

Read more

See How It Works

Create better websites, faster.

Download the Entire Library

Adaptative, neutrally designed components.

Customer Service

Focus Website

Today, February 20

Hi, there 👋

How can I help you?

Start Chat with:

We use cookie to improve your experience on our site. By using our site you consent cookies.