vendredi 6 décembre 2019

WooCommerce conditional statements

I am trying to conditionally show some content based on a few Woocommerce conditionals.

I want to show content when:

  1. Not on a product page

  2. Not on the checkout page

  3. But, on the order received checkout endpoint

The below code is not quite working, the first 2 work correctly but the endpoint doesn't seem to work as it is part of the checkout page? Any ideas how to adjust?

<? if( !is_product() && !is_checkout() && is_wc_endpoint_url('order-received' ): ?>
MY CONTENT
<? endif ?>

Aucun commentaire:

Enregistrer un commentaire