[Astra Theme] Displaying the Availability Status Below the Product Title

PHP snippet for free version of Astra theme.

Make sure that you are using the child theme of Astra theme. Now open the functions.php file of your child theme and drop the following PHP snippets at end of the file.

/**
 * Displaying the stock status below the product title
 * 
 * @copyright 2019 PaulChinmoy.com
 * @author Paul Chinmoy
 */
add_filter( 'woocommerce_get_stock_html', '__return_null', 99, 2 );
add_action( 'woocommerce_single_product_summary', 'paulc_add_stock_html', 6 );
function paulc_add_stock_html() {
	global $product;
	echo astra_woo_product_in_stock( '', $product );
}

PHP snippet for PRO version of Astra theme.

Make sure that you are using the child theme of Astra Pro theme. Now open the functions.php file of your child theme and drop the following PHP snippets at end of the file.

/**
 * Displaying the stock status below the product title
 * 
 * @copyright 2019 PaulChinmoy.com
 * @author Paul Chinmoy
 */
add_action( 'astra_woo_single_title_after', 'paulc_add_stock_html', 9 );
function paulc_add_stock_html() {
	global $product;

	add_filter( 'woocommerce_get_stock_html', '__return_null', 99, 2 );
	echo astra_woo_product_in_stock('', $product );
}
This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.