-1

On Wordpress, I'm trying to set a condition for displaying a widget if the woocommerce cart contains at least one product (any). I'm not sure which code to use, if anyone would like to help me out, Thanks in advance!

1 Answers1

1

This could help:

if(WC()->cart && !WC()->cart->is_empty()){
    // the cart has products
}
Cristino
  • 311
  • 1
  • 7