How To Change Related Products Custom Heading & Subheading In WooCommerce

How To Change Related Products Custom Heading & Subheading In WooCommerce
54 Views

Change Related products Title

<?php
add_filter( 'woocommerce_product_related_products_heading', 'cxc_change_related_products_heading' );
function cxc_change_related_products_heading() {
	return "You May Also Like";
}
?>

Change Related Products Sub Heading

<?php
add_filter( 'woocommerce_product_loop_start', 'cxc_change_releted_products_subheading' );
function cxc_change_releted_products_subheading( $html ) {
	if ( wc_get_loop_prop( 'name', 'related' ) ) {
		$html = '<p>Based on your preferences, you may browse a selection of popular products that other customers saw and purchased Enjoy!</p>'. $html;
	}
	return $html;
}
?>

Was this article helpful?
YesNo

Leave a comment

Your email address will not be published.