Created
May 28, 2022 17:10
-
-
Save qant/5d0248012d516339826ca9e2fe26025c to your computer and use it in GitHub Desktop.
Woocommerce minicart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo '<a href="#" class="dropdown-back" data-toggle="dropdown"> '; | |
echo '<i class="fa fa-shopping-cart" aria-hidden="true"></i>'; | |
echo ' | |
<div class="basket-item-count" style="display: inline;">'; | |
echo '<span class="cart-items-count count">'; | |
echo WC()->cart->get_cart_contents_count(); | |
echo '</span>'; | |
echo ' | |
</div> | |
'; | |
echo '</a>'; | |
echo ' | |
<ul class="dropdown-menu dropdown-menu-mini-cart">'; | |
echo ' | |
<li> | |
<div class="widget_shopping_cart_content">'; | |
woocommerce_mini_cart(); | |
echo ' | |
</div> | |
</li> | |
</ul>'; | |
?> | |
<p>Or:</p> | |
<!-- WORKING MINI CART!!! --> | |
<div> | |
<a href="#" class="dropdown-back" data-toggle="dropdown"> | |
<i class="fa fa-shopping-cart" aria-hidden="true"></i> | |
<div class="basket-item-count" style="display: inline;"> | |
<span class="cart-items-count count"> | |
<?php WC()->cart->get_cart_contents_count(); ?> | |
</span> | |
</div> | |
</a> | |
<ul class="dropdown-menu dropdown-menu-mini-cart"> | |
<li> | |
<div class="widget_shopping_cart_content"> | |
<?php woocommerce_mini_cart(); ?> | |
</div> | |
</li> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fully functional but not styled mini cart where you can interact with it