Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. // Storefront mini cart - don't show it when page loads to avoid flicker because of immediately replaced cached version.
  2. // Pluggable function - if regular function is used, function defined error happens on activation due to plugin loading after theme.
  3. if ( ! is_admin() ) {
  4. if ( ! function_exists( 'storefront_header_cart' ) ) {
  5. function storefront_header_cart() {
  6. if ( storefront_is_woocommerce_activated() ) {
  7. if ( is_cart() ) {
  8. $class = 'current-menu-item';
  9. } else {
  10. $class = '';
  11. }
  12. ?>
  13. <ul id="site-header-cart" class="site-header-cart menu" style="display:none;">
  14. <li class="<?php echo esc_attr( $class ); ?>">
  15. <?php storefront_cart_link(); ?>
  16. </li>
  17. <li>
  18. <?php the_widget( 'WC_Widget_Cart', 'title=' ); ?>
  19. </li>
  20. </ul>
  21. <?php
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement