?
<?php /* *************************************************************** * #WooCommerce Mini Cart *************************************************************** */ ?> <div class="mini-cart-items"> <?php if ( WC()->cart->cart_contents_count === 0 ) : ?> <p class="empty-mini-cart-msg">Your cart is empty!</p> <?php endif; ?> <?php foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item_content ) : ?> <!-- get product with cart item --> <?php $get_product = apply_filters( 'woocommerce_cart_item_product', $cart_item_content['data'], $cart_item_content, $cart_item_key ); ?> <!-- get product with cart item --> <?php if ( $get_product && $get_product->exists() && $cart_item_content['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item_content, $cart_item_key ) ) : ?> <!-- get product price --> <?php $product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $get_product ), $cart_item_content, $cart_item_key ); ?> <div class="mini-cart-item"> <div class="product-image"> <?php $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $get_product->get_image(), $cart_item_content, $cart_item_key ); if ( ! $get_product->is_visible() ) echo $thumbnail; else printf( '<a href="%s">%s</a>', $get_product->get_permalink( $cart_item_content ), $thumbnail ); ?> </div> <div class="product-details"> <?php if ( ! $get_product->is_visible() ) echo apply_filters( 'woocommerce_cart_item_name', $get_product->get_title(), $cart_item_content, $cart_item_key ) . ' '; else echo apply_filters( 'woocommerce_cart_item_name', sprintf( '<h3><a href="%s">%s</a></h3>', $get_product->get_permalink( $cart_item_content ), $get_product->get_title() ), $cart_item_content, $cart_item_key ); ?> <span> <?php echo sprintf( __( 'Quantity: %s × <strong>%s</strong>', 'vika' ) , $cart_item_content['quantity'], $product_price ); ?> </span> </div> <div class="product-subtotal"> <?php echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $get_product, $cart_item_content['quantity'] ), $cart_item_content, $cart_item_key ); ?> </div> </div> <?php endif; ?> <?php endforeach; ?> </div> <div class="mini-cart-footer"> <div class="mini-cart-subtotal"> <?php _e( 'Subtotal', 'vika' ); ?>: <strong><?php wc_cart_totals_subtotal_html(); ?></strong> </div> <?php if( WC()->cart->cart_contents_count !== 0 ) : ?> <div class="mini-cart-buttons"> <div class="view-cart-btn"> <a href="<?php echo WC()->cart->get_cart_url(); ?>" class="btn btn-block"><?php _e( 'View Cart', 'vika' ); ?></a> </div> <div class="checkout-btn"> <a href="<?php echo WC()->cart->get_checkout_url(); ?>" class="btn btn-block btn-primary"><?php _e( 'Checkout', 'vika' ); ?></a> </div> </div> <?php endif; ?> </div>