The fact is that the customer asks for a 50% discount for “Local Pickup” – I have already done this (I found a code here on StackOverFlow that applies a discount on all goods), but there is …
Tag: taxonomy-terms
Get WooCommerce specific product attribute terms sorted by “menu order”
I want to sort get_the_terms by menu_order of the curent product and till now i have this code: Answer There is 2 ways to get the product attribute term names sorted by menu order (for a defined product): 1). Using wp_get_post_terms() function (WordPress way) The WordPress function get_the_terms() doesn’t allow to alter the WP_Term_Query… So instead you will use similar
Display custom taxonomy terms on WooCommerce shop page
I am figuring out how to display a custom taxonomy on the WooCommerce shop loop. I found this answer, which has pointed me in the right direction. I have modified the code from that answer, to the following: The part I am stuck on is this line: I changed was was Vendor and Vendors (the name of the taxonomy) to
If product category has children remove permalink from parent term in WooCommerce
Inspired from get woocommerce categories with subcategory, I am creating a drop down section and I was wondering if there is any way to remove the permalink from the parent category if it has a child category. Here is my code example: How can I display a link on top level product categories terms only when there are no children
Get a list of siblings term ids from current product category in WooCommerce
I want to retrieve a list of term Ids based on the current category ID. At the moment I’m using the following code: $product_cat_items = get_queried_object(); $product_cat_id = $product_cat_items-…
Count only top level WooCommerce product categories form custom shipping calculations
I am using Increase Shipping cost per categories count found in WooCommerce cart answer code from my previous question. How to exclude subcategories from the array of product categories Ids, to keep …
Display sub subcategories terms list on WooCommerce subcategory archive pages
In Woocommerce I use Get the subcategories of the current product category in Woocommerce archives answer function, to display a list of subcategories on the parent category pages But I only need to …
Display custom taxonomy terms on WooCommerce product archive pages
I’ve create a taxonomy called “couchages” for product with value : 1 couchage, 2 couchages, 3 couchages,… I would like to print the value of this taxonomy, for each product on the archive page, like …
How to get the brand name of product in WooCommerce
i need get the brand name of product , i have this code $product = wc_get_product(); $type = $product->get_type(); $name = (string)$product->get_name(); $id = (int)$product->…
Add Product Attributes with values to a product in Woocommerce
I am using this code to add custom attributes The result of this code I got added just product attribute Name without term values… See the picture I searched about that very much but did not got any answer. Answer There is some mistakes in your code. Your main mistake: The attribute terms to save as product meta data (at