I need to add a suffix text to the price of a woocommerce product from a specific category while on WooCommerce cart. Here is my code: The problem is it only works on simple products. Doesn’t seem to affect the prices of variable products (I tested on 3 different sites). Any idea what I’m missing? Answer To make it work
Tag: taxonomy-terms
Display content on WooCommerce single products based on product categories when they have child categories
I am trying to display the test div below on any product page that is in the category cat1title or cat2title. Using the hook below, which I thought was correct, I should be seeing this div on the page but I am not seeing it at all. The page displays just fine but no div. No errors in the console
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: I would like to get only products from “vip” product category. I tried using $product->get_categories() to find “vip” category, but it didn’t worked. How can I show only products from “vip” category? Answer You can try has_term() conditional function for ‘product_cat’ procuct category taxonomy as follows: It
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: How can I avoid this item name repetition on this loop? Answer The variable $product_cat_id is not defined in your code, so your if statement is always true.
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 next created sample tags: One, Two and assigned them to the Product (via ACF plugin) I want them to be displayed on product page. I was trying to use this code: but there is an issue I cannot
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 it, and I can see that the product object get updated with the category id prior to saving. However, when
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 categories and Nike and Red are subcategories. On the product page I have the following code The output is NikeRed Is there
Add extra cost to flat rate shipping each 2 items from specific category in WooCommerce
Based on Add an additional cost to flat rate shipping each 3 items in Woocommerce answer code, I have made some changes to add an additional cost to flat are shipping method each 2 items (instead of …
Remove out of stock products from WooCommerce related products custom WP query
hello I want to show related products based on my custom query but I just want to show ‘in_stocks’ products and meta_query not working with tax_query. anyone can help me? $query_args = array( ‘…
Get taxonomy name
I’m trying to modify a theme that has custom posts with custom taxonomies. At the bottom of the posts it displays a list of other posts (as in “you might also like…”) What I’m trying to do is to filter the posts that are displayed in that area so they match the category of the current post. It’s a tour