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!
Asked
Active
Viewed 283 times
1 Answers
1
This could help:
if(WC()->cart && !WC()->cart->is_empty()){
// the cart has products
}

Cristino
- 311
- 1
- 7