07-27-2023, 04:50 AM
I would like to have a header banner hidden when a user is in the WooCommerce cart or checkout process. **Is there a flag or variable that I can check to see if the current page is in either of these WooCommerce sections?** I basically want to do something like the following:
```
if (!is_checkout() && !is_cart()) {
echo "<div>My Banner</div>";
}
```
I realize I can make a custom page template for each of these sections, but I just want to add a simple bit of code to my global site header.
```
if (!is_checkout() && !is_cart()) {
echo "<div>My Banner</div>";
}
```
I realize I can make a custom page template for each of these sections, but I just want to add a simple bit of code to my global site header.