Hello,
Please add this code to functions.php of the child theme:
function woodmart_stock_status_after_title() {
if ( 'after_title' !== woodmart_get_opt( 'stock_status_position' ) ) {
return;
}
global $product;
$wrapper_class = 'stock';
$wrapper_class .= ' wd-style-default';
$stock_status = $product->get_stock_status();
if ( 'instock' === $stock_status ) {
if ( $product->get_stock_quantity() ) {
$stock_status_text = wc_format_stock_for_display( $product );
} else {
$stock_status_text = esc_html__( 'In stock', 'woodmart' );
}
$wrapper_class .= ' in-stock';
} elseif ( 'onbackorder' === $stock_status ) {
$wrapper_class .= ' available-on-backorder';
$stock_status_text = esc_html__( 'Available on backorder', 'woodmart' );
} else {
$wrapper_class .= ' out-of-stock';
$stock_status_text = esc_html__( 'Out of stock', 'woodmart' );
}
woodmart_enqueue_inline_style( 'woo-mod-stock-status' );
?>
<p class="wd-product-stock <?php echo esc_attr( $wrapper_class ); ?>">
<?php echo esc_html( $stock_status_text ); ?>
</p>
<?php
}
If you have any questions please feel free to contact us.
Best Regards