Well, I found the following solution:
$args = array(
'category' => array( 'category_slug' )
// or 'term_taxonomy_id' => 4 i.e. category ID
);
foreach( wc_get_products($args) as $product ){
foreach( $product->get_attributes() as $attr_name => $attr ){
echo wc_attribute_label( $attr_name ); // attr label
// or get_taxonomy( $attr_name )->labels->singular_name;
foreach( $attr->get_terms() as $term ){
echo $term->name;
}
}
}
Related Posts:
- WooCommerce: One term for Many Product Attributes
- Display single product attribute value on Shop page (Woocommerce)
- Get product details by url key in WordPress woocommerce
- Where is the “default attribute” values located in the phpMyAdmin in Woocommerce?
- Extend Woocommerce rest api routes fails
- Display Categories Assigned to a WooCommerce Product
- woocommerce_before_calculate_totals in woocommerce 3.0
- How to get woocomerce attributes thumbnail in PHP? [closed]
- Can’t create term for product attribute
- Remove “Choose An Option” on Product Variation & Auto Select Instead
- why featured product not updated in postmeta table in woocommerce?
- Programmatically adding product attributes to WP / Woo commerce
- Woocommerce custom search
- WP_Error on attribute + term insert
- Get product variation attribute titles – WooCommerce
- How to change Attribute Type
- WooCommerce – buying as well as selling
- Is it possible to merge Woocommerce attributes? [closed]
- Best Practice – Customise a WooCommerce+WordPress Templates
- How to remove product attribute row woocommerce using code
- WooCommerce Simple Product Options List
- Woocommerce: Any way to list all products *without* a specific attribute?
- wp_set_object_terms setting only first id from array
- Restrict product tags archive to certain users
- Split taxonomies on different pages
- Exclude Specific Product Category for showing up in its parent category page
- How to add product variations for large number of products in WooCommerce?
- WooCommerce: how to set stock per attribute on variable product
- Importing Attributes in to Woocommerce
- Woocommerce: Some action hooks not firing inside class [closed]
- Is it possible Different templates of products for specific category in WooCommerce?
- Display x number of terms and exclude hidden
- WooCommerce – Adding Product Attributes to CSV Export
- WordPress and WooCommerce How to Assign Attribute Based Pricing
- Create templates from attributes for categories
- cannot create product attribute (taxonomy) and add terms on the same execution
- How to display product price of the product in loop
- Limit users to one active subscription in WooCommerce Subscriptions? [closed]
- How do I add a text input field for customers to leave a note on a single WooCommerce product page?
- Use get_term_children to get the sub category of a parent category for the current post
- Auto update cart after quantity change
- Unknow php file in wordpress core [closed]
- woocommerce_get_price filter hook not working for product variation price
- Stop WooCommerce from updating user/user meta after checkout
- Displaying Custom Input Value to Customer Order Details (My Account) page in Woocommerce
- Get rid of product images mobile swipe functionality from WooCommerce single product [closed]
- 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]
- Tax Query for custom Taxonomy field
- Adaptive product filters for WooCommerce
- Do I need a different product type for WooCommerce [closed]
- Feed format for woocommerce [closed]
- How to get woocommerce product collection in template file
- Results not being printed
- Remove ‘product’ & ‘product-cateogory’ from url – woocommerce [closed]
- How to show notice alert only on product dashboard page?
- Retrieving Tag Name in Template Part from Filtered URL
- ajax request in wordpress
- How to customize shipping region/states on WooCommerce
- Woocommerce product rewrite rules not working
- How to display a table below each product in product list/loop
- how to remove this image? [closed]
- How disable some product features on woocomerce?
- WooCommerce – Split Multiple Items into Individual Line Items
- Change “Select Options” label in button to “Buy Now!” in store page
- I want to filter my products with attributes [closed]
- Automatic recurring payment using YITH subscription and Dokan Stripe
- 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)
- Customizing woocommerce product page
- Woocommerce custom log in and register
- 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
- I want to fusion the product columns in email table order
- How to get cookie value?
- Woocommerce Disabling Auto Restocking for Cancelled Orders
- Custom pagination permalink structure Product page
- Woocommerce custom “My Account” Tab – Add Save button
- Woocommerce modifying the html on the checkout page?
- Pseudo class :before don’t working in a specific button
- How to speed up “My Account > Orders Page” on Site with More than 200,000 orders?
- Woocommerce – Remove cart button depending product (post) status
- Editing product categories suddenly crashes website and goes back to wordpress installation
- ACF in WooCommerce mail template
- Merge “description” and “additional informations” product tab
- I need to refresh the checkout page if someone changes the zip code
- add_filter not works in ajax
- Website Tablet Check Out Field Issue
- WooCommerce order created via REST – sending the date_created along
- Get Third Level Categories WooCommerce
- Change wp-login.php? Problem with .htaccess password protection and multi user shop
- Conditional email recipient based off Shipping Method [closed]
- Show pop up message for specific categoryies
- How to show detailed order history on woocommerce product page [closed]
- Display woocommerce product_cat child terms with thumbnails
- Add custom ID to WooCommerce product tab