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
4
votes
1 answer

Display linked product attribute term names in Woocommerce

This is my code for display an atributte below a product title. How can I display it like a link to archive page of this attributte? add_action( 'woocommerce_single_product_summary', 'custom_template_single_title', 5 ); function…
4
votes
1 answer

Exclude 'hidden' queried products from carousel in WooCommerce 3+

I have a carousel plugin which does various things and it only shows published products: $common_args = array( 'post_type' => 'product', 'posts_per_page' => !empty($posts_per_page) ? intval($posts_per_page) : 4, …
Lyall
  • 1,367
  • 3
  • 17
  • 42
3
votes
1 answer

Show product categories in a new column on WooCommerce "My account" orders table

I want to add a custom column, to display the product categories on the orders history table in wooCommerce I found how to add a custom column but I can't seem to display the taxonomy's product linked to the order in this column. For this example, I…
3
votes
2 answers

Check for a product category in a hooked function for WooCommerce products

I want to check the category of WooCommerce products in function.php. That is my code: function for_preorder() { ///// DISPLAY something if category id = 50 } add_action('woocommerce_before_single_product','for_preorder'); How to check for a…
3
votes
2 answers

Issue with WooCommerce WC_Product set_category_ids() method in ACF "acf/save_post" hook

I have a problem assigning a product category to a Woocommerce product that I create with Php. (Environment is Wordpress 5.6.1, Woocommerce 5.0, Php 7.4.14, ACF Pro 5.9.5, Oxygen 3.6.1) All other attributes for the product gets saved while creating…
Nick Las
  • 33
  • 3
3
votes
1 answer

Sort specific product category cart items at the end in WooCommerce

How to sort items from a defined product category to be at the end of a cart order, for example I want all products that belong to a product category 'bottle' to be at the end of the cart order. I have found this code that sorts by price, but would…
neilgee
  • 528
  • 1
  • 6
  • 17
3
votes
2 answers

Comma separated product attribute terms if there are multiple values available

In WooCommerce, I'm currently building a function that will echo some product attributes in the shop page. I would like to separate these with commas if there is multiple attribute values available, but I don't know how. My…
Josh933
  • 35
  • 4
3
votes
1 answer

Update programmatically custom attribute value set in a WooCommerce product

If I already have existing product attributes and then use the function below, it removes existing attributes from the product and replaces them with this one attribute. I only want to update this one attribute value with a new value…
simlpymarkb
  • 335
  • 4
  • 11
3
votes
1 answer

How to Redirect specific category product pages to cart page in Woocommerce

i want to redirect users when they click single page product directly to cart without going to product description page for only one category products. i used this code: add_action( 'wp', 'ts_redirect_product_pages', 99 ); function…
3
votes
1 answer

Display WooCommerce My account Orders only when items belong to specific category

So I am building a custom section on the WooCoommerce's my account/my-orders.php template file to only show order history of any products that are under the category "courses". I currently have this:
3
votes
1 answer

How to get product category ids from order items in WooCommerce

I am working on to get the categories of each product which is ordered using below code. function get_order_detail($order_id){ $order = wc_get_order( $order_id ); foreach ($order->get_items() as $item_key => $item ){ $product =…
D p
  • 93
  • 8
3
votes
1 answer

Display WooCommerce Custom Product Attributes and all terms on single products

I created six custom attributes on the WooCommerce single product page with a custom function. They consist of: an icon, a label and terms. Based on Replace WooCommerce attribute labels by a custom image for each answer code, I used the following…
3
votes
2 answers

Show WooCommerce parent category thumbnail when viewing a child category

I have a function that returns the product Category Thumbnail on the Archive pages for WooCommerce. This is working great. What I would like to do, is be able to return the Parent Category Thumbnail when viewing Child Categories. Here is the code…
CS10
  • 157
  • 1
  • 9
3
votes
2 answers

Woocommerce tag list having specific string

The code works perfectly for listing WooCommerce product tags, but I want to add a query with it. I would like to list only product tags that contain a specific String. 'product_tag', …
3
votes
2 answers

Get (and display) other posts that match ACF relationship field

I have an ACF relationship field called products. This field is present on the custom post type called resources. In resources, I have three blogs, titled: Blog 1 Blog 2 Blog 3 Blog 1 has the products field set to "Premium". Blog 2 also has this…
1
2
3
32 33