Questions tagged [taxonomy-terms]

Terms are usually associated to custom taxonomies in Wordpress

Use this tag if you mean terms used for custom taxonomies in Wordpress

486 questions
2
votes
1 answer

How to get last 5 posts title of taxonomy?

I have a coupon website and I want to add schema on my coupon store page. suppose I have an amazon store and added 5 coupon posts on amazon. Now, I want to add these 5 post titles and post links to the schema. could you please tell me how can I do…
2
votes
2 answers

Target WooCommerce product category archive pages from a child category term

I have a question regarding the product category. I have a category like that: -electronic -- laptop -- mobile then I want to create a logic for all product under electronic, I use is_product_category( ‘electronic’ ), but it doesn't work for…
Sallar Rabiei
  • 630
  • 1
  • 12
  • 33
2
votes
1 answer

Filter a custom product loop to get products from a category in WooCommerce

I have this function which calls me all products type "promotion_package" in WooCommerce: is_type( 'promotion_package' ) || ! $product->is_purchasable() ||…
2
votes
1 answer

Display orders items names excluding a product category in WooCommerce

With WooCommerce, I have faced a problem on my code below: I have tried skip specific category from my loop. Product has been skipped but some remaining products are showing multiple times: foreach ( $order->get_items() as $item_id => $item ) { …
Kane
  • 605
  • 2
  • 8
  • 22
2
votes
1 answer

How to get meta data from WooCommerce product attribute terms

The meta_value of a particular attribute list holds the name of an image. Is there a way I can access the list of meta_values for an attribute? This gives me all the names but I need the meta_values as well: global $product;…
Jon Glazer
  • 783
  • 1
  • 10
  • 25
2
votes
1 answer

WooCommerce product custom additional taxonomy in a loop issue

I am trying to display custom taxonomy field's names and descriptions for single products in a loop. I've created custom product taxonomy add_action( 'init', 'create_distinctions_nonhierarchical_taxonomy', 0 ); function…
2
votes
1 answer

How to get the terms from WooCommerce product attribute taxonomies?

With the following code I populate a select dropdown item in Admin product page which I add, through a function (in my theme's functions.php). For instance, I managed to get the list of all my product attributes (taxanomy):
evavienna
  • 1,059
  • 11
  • 29
2
votes
1 answer

Display custom content for specific product tags in Woocommerce single product pages

I use the below to add custom html or a text in WooCommerce single product pages, after short description: function my_content( $content ) { $content .= '
Custom content!
'; return…
ClawDuda
  • 123
  • 3
2
votes
1 answer

WooCommerce: Filter Admin orders by product attribute term

I have a store with many variable products. All orders are custom made specifically for the customer. This means that when we receive the product in the warehouse we need to find the order of the specific product. Right now we simply have to…
John Smith
  • 67
  • 1
  • 1
  • 14
2
votes
1 answer

Get only one product category term for a WooCommerce product

I have a mystery with the categories from WooCommerce. For different products I have multiple categories. For example the product Nike Air Red I connect this product with two categories Brands->Nike and Shoes->Red Brands and Shoes are main…
Bert
  • 55
  • 6
2
votes
1 answer

Disallow WooCommerce checkout only when items from 2 categories are in cart

I have 3 categories "other", "category D" and "category T" : • If the user has in his basket products belonging to the 3 categories, the payment is accepted. • If the user has in his basket products belonging to “category D” and to “other”,…
w.a
  • 31
  • 7
2
votes
1 answer

Using get_the_terms() doesn't return child terms of a specific parent category applied to a WooCommerce product

After numerous attempts and about 50 articles I am reaching the conclusion this is not possible, unless there is a wizard out there willing to tear me a page out of their spell book. When on a product page, I wish to grab the current product ID and…
Jason Is My Name
  • 929
  • 2
  • 14
  • 38
2
votes
2 answers

How to add a custom field to all Woocommerce attribute terms using add_action

On the Woocommerce Product Attributes page, I have the following working for one Woocommerce attribute (called myattribute). The following adds the custom field to the add / edit page of the terms for myattribute: add_action(…
Mike A
  • 430
  • 1
  • 5
  • 14
2
votes
1 answer

Set a minimum order value for except for product tags in WooCommerce

I currently have a wordpress site with a minimum order value set for my WooCommerce store, set up in my functions.php and it works perfectly. I now want to set one product tag as an exception to this rule, and have no minimum order value for this...…
David
  • 319
  • 2
  • 5
  • 18
2
votes
1 answer

Filter by product attribute terms in a WooCommerce WC_Product_Query

I am trying to create a loop for products using WC_Product_Query. Now I want to filter them by Product Attributes. Using WP Query it is possible to do this, with tax_query. But using WC_Product_Query it does not work. (I do not want a WP_Query,…
Adiel
  • 87
  • 3
  • 10