I am trying to add the category description text from a woocommerce product category to a layout. Here's the development site for reference hidden link
I popped in a placeholder for now [wpv-woo-productcategory-description]
cheers,
It seems that this is accessible as described here on the WooCommerce Documentation page:
hidden link
hidden link
$cat_id=$category->term_id;
$prod_term=get_term($cat_id,'product_cat');
$description=$prod_term->description;
There are other tutorials as well:
hidden link
hidden link
If you return this in a ShortCode you should be able to output it anywhere afterwards.
But you should as well be able to get this data from native Toolset ShortCodes:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-taxonomy-description
https://toolset.com/forums/topic/woocommerce-taxonomy-description/
https://toolset.com/forums/topic/display-woocommerce-product-select-by-taxonomy-custom-on-a-wordpress-page/
Just, this works only on a Taxonomy View or Taxonomy Archive - no matter if used in a Layout or not.
Again, as well there are other approaches you can take, but they involve Custom Code:
https://toolset.com/forums/topic/how-to-display-woocommerce-product-categories-image-in-views/
Thank you for the comprehensive answer with different approaches!
as always, you rock!
I am still having a bit of trouble with displaying the woo commerce category description. I have created a layout and a view within that to display the category description, per your advice.
It seems to work on some pages: hidden link
But not on others, this page shows a parent description (from /womens_clothing/), not of the current category:
hidden link
the view settings are:
Content Selection: Taxonomy>Product Categories
Display:1
Query Filter: Taxonomy term filter
Taxonomy is set by the current post
Loop: [wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-taxonomy-description]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"][/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]
I am stumped, any direction would be welcomed. Thanks a bunch.
Edit*
I just noticed the infobar saying I should open a new ticket..oops, opening new ticket now.