Custom Flat Rate Description Text in Woocommerce checkout page

✔ Recommended Answer

The correct hooked function to add additional information to your shipping "flat rate" methods is:

add_action( 'woocommerce_after_shipping_rate', 'action_after_shipping_rate', 20, 2 );function action_after_shipping_rate ( $method, $index ) {    // Targeting checkout page only:    if( is_cart() ) return; // Exit on cart page    if( 'flat_rate:1' === $method->id ) {        echo __("<p>Arriving on your chosen date between 9am - 1pm Perfect for business addresses & special occasions</p>");    }    if( 'flat_rate:2' === $method->id ) {        echo __("<p>Arriving on your chosen date between 9am - 7pm Perfect for residential addresses</p>");    }}

This code goes on function.php file of your active child theme (or active theme). tested and works.

Source: stackoverflow.com

Answered By: LoicTheAztec

Method #2

To add a custom flat rate description text in the WooCommerce checkout page, follow these steps:

  1. Go to your WordPress dashboard and navigate to WooCommerce > Settings.
  2. Click on the Shipping tab and then click on the Flat Rate shipping method.
  3. In the Flat Rate shipping method settings, scroll down to the "Method Description" field.
  4. Enter your custom flat rate description text in the Method Description field.
  5. Save your changes.

Now, your custom flat rate description text will be displayed on the checkout page for customers to see. It's important to note that the text you enter in the Method Description field will replace the default flat rate description text, so be sure to include all relevant information about your flat rate shipping method in your custom text.

Comments

Most Popular

Remove Unicode Zero Width Space PHP

PhpStorm, return value is expected to be 'A', 'object' returned

Laravel file upload returns forbidden 403, file permission is 700 not 755