Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created January 22, 2020 05:56
Show Gist options
  • Save yousufansa/892df9b4d06404b83c088f4e9cc87876 to your computer and use it in GitHub Desktop.
Save yousufansa/892df9b4d06404b83c088f4e9cc87876 to your computer and use it in GitHub Desktop.
Electro - Mobile Header Cart Link issue on Offcanvas Cart Enabled Fix
if ( ! function_exists( 'electro_handheld_footer_bar_cart_link' ) ) {
function electro_handheld_footer_bar_cart_link() {
$header_cart_icon = apply_filters( 'electro_header_cart_icon', 'ec ec-shopping-bag' );
if ( is_woocommerce_activated() ) {
$cart_link = wc_get_cart_url();
?>
<a class="footer-cart-contents" href="<?php echo esc_url( $cart_link ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'electro' ); ?>">
<i class="<?php echo esc_attr( $header_cart_icon ); ?>"></i>
<span class="cart-items-count count"><?php echo wp_kses_data( WC()->cart->get_cart_contents_count() );?></span>
</a>
<?php
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment