How to change the colon after the lead time prefix
When you are using WooCommerce Lead Time to display lead times with a prefix, then this will normally appear in the format "Lead time: 5 Days" on the cart, checkout and order details - i.e. separated by a colon. You have full control over the format of the lead time on the single product page, and the colon is not added there automatically.
This article is aimed at developers and explains how to replace the colon with a different symbol.
When the lead time is set to display on the Cart, Checkout, or Order details then the lead time data is sent to WooCommerce as item data. WooCommerce will then output this data in the relevant areas.
WooCommerce expects this data to be provided in a label → value format.
WooCommerce Lead Time sends the lead time prefix as the label, and the actual lead time as the value. If you do not have a prefix then the label will default to ‘Lead time'.
WooCommerce will then output this data separating the label and value (i.e. lead time prefix and the main lead time) with a colon.
If your lead time prefix already contains a colon
: or dash
- separator then WooCommerce Lead Time will automatically take this into account and send the item data without these separators so that WooCommerce can cleanly output the data using the default colon separator.
It is possible to customize the output of this in some areas and this would need to be handled within the scope of your theme or child theme. This is a complex developer-level task.
The output is handled by the
wc_get_formatted_cart_item_data function in WooCommerce and this is used in various templates from WooCommerce.
It is important to note that any of these customizations would affect all item data that might be applied to a product and not just the lead time.