<?php
use Prodigy\Includes\Helpers\Prodigy_Url_Helper;
use Prodigy\Includes\Helpers\Prodigy_Widget_Options;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( $show_breadcrumbs ) :
	?>
	<nav>
		<ol class="prodigy-breadcrumbs prodigy-custom-template">
			<input type="hidden" class="category-name-js" value="<?php echo esc_attr( get_query_var( 'term' ) ); ?>">
			<input type="hidden" class="slug-name-js" value="<?php echo esc_attr( get_query_var( 'taxonomy' ) ); ?>">
			<li class="prodigy-breadcrumbs__item">
				<a class="prodigy-breadcrumbs__item-link"
					href="<?php echo esc_url( get_home_url() ); ?>"
					rel="nofollow noopener"
					aria-label="<?php esc_html_e( 'Visit Home page', 'prodigy-commerce' ); ?>"
				>
					<?php esc_html_e( 'home', 'prodigy-commerce' ); ?></a>
			</li>
			<li class="prodigy-breadcrumbs__item-divider" aria-hidden="true" role="presentation">
				<span>/</span>
			</li>
			<li class="prodigy-breadcrumbs__item">
				<a class="prodigy-breadcrumbs__item-link"
					href="<?php echo esc_url( Prodigy_Url_Helper::prodigy_get_shop_url() ); ?>"
					rel="nofollow noopener"
					aria-label="<?php esc_html_e( 'Visit Shop page', 'prodigy-commerce' ); ?>"
				>
					<?php esc_html_e( 'shop', 'prodigy-commerce' ); ?></a>
			</li>
			<?php if ( ! empty( $category_name ) && isset( $url_to ) && Prodigy_Widget_Options::$bool_mapper[ $style_curr_page ] ) : ?>
				<li class="prodigy-breadcrumbs__item-divider" aria-hidden="true" role="presentation">
					<span>/</span>
				</li>
				<li class="prodigy-breadcrumbs__item" aria-current="page">
					<?php echo esc_html( mb_strtolower( $category_name ) ); ?>
				</li>
			<?php endif; ?>
		</ol>
	</nav>
	<?php
endif;
?>
