wc_update_product_archive_title()WC 1.0

Update the product archive title to the title of the shop page. Fallback to 'Shop' if the shop page doesn't exist.

No Hooks.

Returns

String.

Usage

wc_update_product_archive_title( $post_type_name, $post_type );
$post_type_name(string) (required)
Post type 'name' label.
$post_type(string) (required)
Post type.

wc_update_product_archive_title() code WC 9.8.5

function wc_update_product_archive_title( $post_type_name, $post_type ) {
	if ( is_shop() && 'product' === $post_type ) {
		$shop_page_title = get_the_title( wc_get_page_id( 'shop' ) );
		if ( $shop_page_title ) {
			return $shop_page_title;
		}

		return __( 'Shop', 'woocommerce' );
	}

	return $post_type_name;
}