Last active
August 26, 2019 12:34
-
-
Save noellesteegs/9b6d35a0bac141d874d766878c95b548 to your computer and use it in GitHub Desktop.
Add text above cart form @ WooCommerce single product if in particular category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_before_add_to_cart_form', 'category_notice' ); | |
function category_notice() { | |
if (has_term('accessories', 'product_cat')) { // Replace 'accessories' with your category | |
echo '<div class="category_notice"><p>This is a notice.</p></div>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment