cl01/wp-content/themes/hester/woocommerce/cart/header-widget/icon.php
2025-02-24 12:39:24 +08:00

23 lines
633 B
PHP
Executable File

<?php
/**
* Header Cart Widget icon.
*
* @package Hester
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$hester_cart_count = WC()->cart->get_cart_contents_count();
$hester_cart_icon = apply_filters( 'hester_wc_cart_widget_icon', 'shopping-bag' );
?>
<a href="<?php echo esc_url( wc_get_cart_url() ); ?>" class="hester-cart">
<?php echo hester()->icons->get_svg( $hester_cart_icon ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php if ( $hester_cart_count > 0 ) { ?>
<span class="hester-cart-count"><?php echo esc_html( $hester_cart_count ); ?></span>
<?php } ?>
</a>