cart->get_cart_contents_count()
// @codingStandardsIgnoreEnd
);
?>
';
$item_count_text = sprintf(
/* translators: number of items in the mini cart. */
'%d',
WC()->cart->get_cart_contents_count()
);
$output .= '';
$output .= '' . esc_html( $item_count_text ) . '';
$output .= '';
return $output;
}
}
if ( ! function_exists( 'zakra_woocommerce_header_cart' ) ) {
/**
* Display Header Cart.
*
* @return string
*/
function zakra_woocommerce_header_cart() {
$output = '';
if ( is_cart() ) {
$class = 'current-menu-item';
} else {
$class = '';
}
$output .= '';
return $output;
}
}
if ( ! function_exists( 'zakra_woocommerce_page_title' ) ) :
/**
* Manage WooCommerce page title.
*
* @return string
*/
function zakra_woocommerce_page_title() {
if ( 'page-header' === get_theme_mod( 'zakra_page_title_enabled' ) ) {
return false;
}
return true;
}
endif;
add_filter( 'woocommerce_show_page_title', 'zakra_woocommerce_page_title' );
if ( ! function_exists( 'zakra_woocommerce_remove_product_title' ) ) :
/**
* Remove product title if it's shown in page header.
*/
function zakra_woocommerce_remove_product_title() {
if ( 'page-header' === get_theme_mod( 'zakra_page_title_enabled', 'page-header' ) ) {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
}
}
endif;
add_action( 'wp_loaded', 'zakra_woocommerce_remove_product_title' );
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
if ( ! function_exists( 'zakra_woocommerce_get_sidebar' ) ) :
/**
* Get WooCommerce Sidebar.
*/
function zakra_woocommerce_get_sidebar() {
// Hide sidebar when sidebar is not present.
if ( in_array( zakra_get_current_layout(), array(
'tg-site-layout--no-sidebar',
'tg-site-layout--default',
'tg-site-layout--stretched'
), true ) ) {
return;
}
// Get site layout from customizer and page setting.
$current_sidebar = zakra_get_current_layout();
$sidebar = '';
if ( 'tg-site-layout--left' === $current_sidebar ) {
$sidebar = 'wc-left-sidebar';
} elseif ( 'tg-site-layout--right' === $current_sidebar ) {
$sidebar = 'wc-right-sidebar';
}
if ( ! is_active_sidebar( $sidebar ) ) {
return;
}
?>