Halloween Sale 15% off Ends in See the plans
PHP

Descriptions Under Shipping Methods

Prints a short explanation under each shipping option at checkout, such as delivery times or "signature required", so customers know what they are choosing.

Don’t have WPIDE yet? Install it on your site

Code

$wpide_rate_notes = array( // Rate ID or method ID => description.
    'free_shipping' => 'Delivered in 3 to 5 working days.',
    'flat_rate'     => 'Tracked delivery in 1 to 2 working days.',
    'local_pickup'  => 'Collect from our shop, usually ready within 2 hours.',
);

add_action( 'woocommerce_after_shipping_rate', function ( $rate ) use ( $wpide_rate_notes ) {
    $text = $wpide_rate_notes[ $rate->get_id() ] ?? ( $wpide_rate_notes[ $rate->get_method_id() ] ?? '' );

    if ( '' !== $text ) {
        printf( '<br><small class="wpide-rate-note">%s</small>', esc_html( $text ) );
    }
} );

Notes

Keys can be rate IDs (flat_rate:1) or method IDs (local_pickup), and the notes show on the classic cart and checkout.

How to add this snippet

  1. Install WPIDE on your WordPress site (it is free) and open Code Snippets.
  2. Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
  3. It is added inactive: review the code and settings, then switch it on.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.

Which site should get this snippet?

Enter the address of your WordPress site. WPIDE opens there in a new tab with the snippet ready to review and save.

Remembered in this browser only, so you are asked once.

Report this snippet

Tell the WPIDE team what is wrong: broken code, something harmful, spam or copied work.