Template functions
WooCommerce Lead Time comes with a number of template functions which developers can use to customize the plugin.
wclt_get_lead_time
This function can be used in your theme or plugin to retrieve the lead time for a specific product, passing the product as an argument. It will also include the lead time prefix or suffix.
Use wclt_get_lead_time_raw instead to include the lead time without the prefix or suffix.
Arguments
WC_Product $product - The product object you wish to retrieve the lead time for.
Return
String - The full lead time string include the prefix which is set in the global settings.
Example
$product = wc_get_product( get_the_ID() );
$lead_time = wclt_get_lead_time( $product );
wcltgetlead_time
This function can be used in your theme or plugin to retrieve the lead time for a specific product, passing the product as an argument. It retrieves the lead time field on its own, without the lead time prefix or suffix.
Arguments
WC_Product $product - The product object you wish to retrieve the lead time for.
Return
String - The lead time string without the prefix or units.