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.
Opens WPIDE on
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
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.