Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created October 13, 2020 14:33
Show Gist options
  • Select an option

  • Save yousufansa/24648b36971e5d00c6e215a8dc5e6b8e to your computer and use it in GitHub Desktop.

Select an option

Save yousufansa/24648b36971e5d00c6e215a8dc5e6b8e to your computer and use it in GitHub Desktop.
Electro - Wishlist in Mobile Header
if( ! function_exists( 'ec_child_add_wishlist' ) ) {
function ec_child_add_wishlist( $links ) {
$links['wishlist'] = array(
'priority' => 40,
'callback' => 'ec_child_wishlist_header_link'
);
return $links;
}
}
add_filter( 'electro_handheld_header_links', 'ec_child_add_wishlist', 10 );
if( ! function_exists( 'ec_child_wishlist_header_link' ) ) {
function ec_child_wishlist_header_link() {
if ( function_exists( 'yith_wcwl_count_products' ) && function_exists( 'electro_get_wishlist_url' ) ) :
?>
<a href="<?php echo esc_attr( electro_get_wishlist_url() ); ?>" class="nav-link">
<i class="<?php echo esc_attr( apply_filters( 'electro_wishlist_icon', 'ec ec-favorites' ) ); ?>"></i>
<?php if ( apply_filters( 'electro_show_wishlist_count', false ) ) : ?>
<span class="navbar-wishlist-count count" class="value"><?php echo yith_wcwl_count_products(); ?></span>
<?php endif; ?>
</a>
<?php
endif;
}
}
.mobile-header-v2 .handheld-header-links > ul li.wishlist > a,
.handheld-header-v2 .handheld-header-links > ul li.wishlist > a {
padding: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment