Woocommerce’s product categories are custom taxonomy terms, so you need to use the taxonomy functions (eg, has_term()
) rather than WordPress’ category ones.
function filter_woocommerce_short_description( $post_excerpt ) {
global $post;
if ( has_term( "term-name", "product_cat", $post->ID ) ) {
$post_excerpt .= "<br/>" . "Test";
}
return $post_excerpt;
};
add_filter( 'woocommerce_short_description','filter_woocommerce_short_description',10, 1 );
Related Posts:
- How to display product price of the product in loop
- How to disable Woocommerce password recovery and use the default WordPress password reset page?
- Limit users to one active subscription in WooCommerce Subscriptions? [closed]
- WooCommerce add_to_cart() with custom price [closed]
- Declaring custom woocommerce product type as virtual / downloadable only [closed]
- How to remove_action inside class [duplicate]
- Redirect if current user is logged out and current page is /my-account
- wc_get_product in a none woocommerce page
- WP WPQuery, not running properly in WP CLI
- How to get all products from an order including variations via SQL query?
- What is the action hook for an order that fails on frontend checkout in WooCommerce?
- Woocommerce change tax rate programmaticly
- How to echo billing phone number under My Account in Woocommerce? [closed]
- Unknow php file in wordpress core [closed]
- woocommerce_get_price filter hook not working for product variation price
- WooCommerce shipping – Different product different shipping? [closed]
- Remove action added through function
- Filter get_adjacent_post to follow woocommerce product category
- Run function on “Place Order” [closed]
- Stop WooCommerce from updating user/user meta after checkout
- Displaying Custom Input Value to Customer Order Details (My Account) page in Woocommerce
- Add custom order meta to Order Completed email
- Hiding products with a specific tag from WooCommerce main shop page
- How to upload Woocommerce product images via API? [closed]
- how to do a processing Orders into Complete after x Minutes or x hour in WooCommerce [closed]
- show content of a page built using yootheme builder on different page/template
- How to detect if this post is a woocommerce product?
- Set a custom field to all orders
- Force User Registration before visitng Checkout Page
- Complex price options. Am I stuck with 180 variations?
- Position image widget in mega menu
- Tax Query for custom Taxonomy field
- Improve WooCommerce checkout process [closed]
- How can I put the contents of My Account > Order into a separate page, Woocommerce
- WooCommerce Cart URL bug
- WP_Error on attribute + term insert
- Feed format for woocommerce [closed]
- Convert WordPress Woocomerce product to WordPress post
- How to get woocommerce product collection in template file
- How to set the meta description of a WooCommerce product as its primary category description?
- ajax request in wordpress
- Woocommerce product rewrite rules not working
- How to display a table below each product in product list/loop
- how to remove this image? [closed]
- Create a shortcode for native WooCommerce search form [closed]
- WooCommerce – Split Multiple Items into Individual Line Items
- Change “Select Options” label in button to “Buy Now!” in store page
- How to use Custom Field to display product brief description in shop page with Woocommerce?
- Woocommerce product import exports product with price rounded to integer? [closed]
- How to hook to function of woocommerce product export _regular_price?
- porto theme pagination on woocommerce not working
- Adding preference buttons to main nav that persist via user sessions. (Woocommerce)
- Woocommerce custom log in and register
- Add “new” tag for existing products
- CallBack URL for payment gateway redirecting to homepage instead of executing callback function
- Display when items are in Woocommerce cart but hide when empty
- Printing product variation return array to string conversion error
- woocommerce deposit Form with AJAX and shortcode won’t update but add to previous output
- How to retrieve a Menu Name by Menu Location with ACF fields
- How to update permalink programmatically?
- Woocommerce Disabling Auto Restocking for Cancelled Orders
- Custom pagination permalink structure Product page
- Display shipping class in single product page woocommerce
- Is it ok to 301 redirect product-category pages to custom pages?
- Editing product categories suddenly crashes website and goes back to wordpress installation
- ACF in WooCommerce mail template
- Woocommerce – Add custom email footer to specific email template
- WooCommerce related product – only show from primary category
- Woocommerce: Variable Product – get variation name
- Merge “description” and “additional informations” product tab
- I need to refresh the checkout page if someone changes the zip code
- Correct method of reducing the number of images created by WP and Woo together
- add_filter not works in ajax
- How to skip woocommerce checkout after payment page? [closed]
- Product thumbnail size in catalog
- WordPress Migration
- how can i import the csv file in wordpress woocommerce.?
- some products free and some product is not free for shipping
- Change wp-login.php? Problem with .htaccess password protection and multi user shop
- Conditional email recipient based off Shipping Method [closed]
- Save Woocomerce discount as percentage to database
- Woocommerce Shipping based on condition and cart value
- Show pop up message for specific categoryies
- How to bypass Woocommerce checkout validation from the plugin? [closed]
- Category with description and thumbnail
- Custom product loop avoiding duplicates
- Woocommerce – Remove ‘Buy Product’ Button + Make Product Thumbnails Clickable
- Issue with Woocommerce and extra field in orders data
- How to show detailed order history on woocommerce product page [closed]
- Give auto discount to upsells products
- Making product image in woocommerce invoice linkable [closed]
- Woocommerce checkout column total too small can not get it wider [closed]
- Can I remove WooCommerce specific product categories from shop managers?
- Fetch products with filter by similar categories at same time
- Trying query woocommerce product order by menu order and stock status
- editing product page template – getting template for related products not working
- Woocommerce | I want to the button ‘Add to Cart’ on the (all) product-page changed by just ‘open product’ button
- Adding line breaks in WooCommerce order processing emails
- Disable Woocommerce Block Editor
- Woocommerce backend sorting product drag drop by menu_order to date