Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Storefront mini cart - don't show it when page loads to avoid flicker because of immediately replaced cached version.
- // Pluggable function - if regular function is used, function defined error happens on activation due to plugin loading after theme.
- if ( ! is_admin() ) {
- if ( ! function_exists( 'storefront_header_cart' ) ) {
- function storefront_header_cart() {
- if ( storefront_is_woocommerce_activated() ) {
- if ( is_cart() ) {
- $class = 'current-menu-item';
- } else {
- $class = '';
- }
- ?>
- <ul id="site-header-cart" class="site-header-cart menu" style="display:none;">
- <li class="<?php echo esc_attr( $class ); ?>">
- <?php storefront_cart_link(); ?>
- </li>
- <li>
- <?php the_widget( 'WC_Widget_Cart', 'title=' ); ?>
- </li>
- </ul>
- <?php
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement