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
|
@ -54,6 +54,8 @@ class WooCommerce_Widget_Cart extends WP_Widget {
|
|||
|
||||
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'];
|
||||
|
||||
if ( $_product->exists() && $cart_item['quantity'] > 0 ) {
|
||||
|
|
Loading…
Reference in New Issue