Hide items from cart widget.
Useful for hiding dummy cart items. "Product Bundles" uses this to only show bundled products when pricing is per-item (emphasis on contents), or to hide them when pricing is fixed for the whole bundle (emphasis on bundle).
This commit is contained in:
parent
4f6690c656
commit
e98005a27c
|
@ -53,7 +53,9 @@ class WooCommerce_Widget_Cart extends WP_Widget {
|
||||||
if ( sizeof( $woocommerce->cart->get_cart() ) > 0 ) {
|
if ( sizeof( $woocommerce->cart->get_cart() ) > 0 ) {
|
||||||
|
|
||||||
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $cart_item ) {
|
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $cart_item ) {
|
||||||
|
|
||||||
|
if ( apply_filters('woocommerce_widget_cart_hide_item', 'show', $cart_item, $cart_item_key) == 'hide' ) continue;
|
||||||
|
|
||||||
$_product = $cart_item['data'];
|
$_product = $cart_item['data'];
|
||||||
|
|
||||||
if ( $_product->exists() && $cart_item['quantity'] > 0 ) {
|
if ( $_product->exists() && $cart_item['quantity'] > 0 ) {
|
||||||
|
|
Loading…
Reference in New Issue