Home › Forums › WoodMart support forum › How to change the Estimated delivery text and date format

How to change the Estimated delivery text and date format

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #731027

    leojewelry.watch
    Participant

    We use the Estimated delivery feature on our WooCommerce site
    We want to change the text shown by this feature on the product page, cart, checkout and emails. We want to replace both the label and the sentence structure with our own wording, and also change the date format.

    We could not find options for this in Theme Settings or in the Product estimate delivery widget.

    How can we change the full text of the Estimated delivery message?
    How can we change the date format of the delivery date?

    We prefer a solution without installing a translation plugin, if possible.

    #731037

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    1. Date format

    There is already a setting for this. Navigate to Dashboard -> Theme Settings -> Shop -> Estimate delivery and find the Date format option. By default it is set to “From WordPress settings”, which uses the format from Settings -> General. You can pick a different format from the list there.

    See Screenshots for better understanding: https://postimg.cc/Sjphw59Q

    2. Estimated delivery text

    You can use the Loco Translate plugin to modify these strings.

    Please follow this guide: https://xtemos.com/docs-topic/translate-woodmart-theme-with-loco-translate/

    If you do not want to use a translation plugin, You can add this code in your child theme’s functions.php. Change the wording to your own:

    add_filter( 'gettext', function ( $translation, $text, $domain ) {
    	if ( 'woodmart' !== $domain ) {
    		return $translation;
    	}
    	$map = array(
    		'Estimated delivery'          => 'Your order arrives',
    		'Earliest estimated delivery' => 'Earliest arrival',
    		'Latest estimated delivery'   => 'Latest arrival',
    		'Overall estimated delivery'  => 'Your whole order arrives',
    		'Estimated delivery dates'    => 'Your order arrives',
    	);
    	return isset( $map[ $text ] ) ? $map[ $text ] : $translation;
    }, 20, 3 );

    Best Regards

Viewing 2 posts - 1 through 2 (of 2 total)