taxonomy-terms

Hide specific product attribute terms on WooCommerce variable product dropdown [closed]

 ̄綄美尐妖づ 提交于 2020-08-09 09:08:19
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 months ago . Improve this question I would like to hide one attribute with all the values. Please see the link. https://csepromos.nl/product/oregon-400-ml-drinkfles-met-karabijnhaak/ I would like to hide the below attribute and the below values on the product page: Filter kleur: Grijs Groen Oranje Paars Rood

How to get the brand name of product in WooCommerce

坚强是说给别人听的谎言 提交于 2020-07-18 08:32:26
问题 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->get_id(); $sku = (int)$product->get_sku(); $precio = (int)$product->get_price(); $brand_name = $product->get_brand(); ---> ??? i get this attributes but i don't know how catch the brand name, is there another way ? Thanks! 回答1: Use get_the_terms get_the_terms($product->get_id(),'pa_brand') 回答2: Is better to use wc_get

Display Variable Product Attributes and Terms on Woocommerce Archives

ⅰ亾dé卋堺 提交于 2020-07-03 08:56:35
问题 I am trying to accomplish a attribute and term list on the shop page using the hook woocommerce_shop_loop_item_title . The goal is to get the attribute(s) and term(s) for the product and then to display it like this example: Color: Red, Blue, Green Size: Small, Medium, Large Dimensions: 90*90, 100*100 and 120*120 but without the spaces between the rows. It should "fetch" all the attributes used with the product and the attributes terms. I've tried this but got fatal error. add_action(

Display Variable Product Attributes and Terms on Woocommerce Archives

守給你的承諾、 提交于 2020-07-03 08:51:51
问题 I am trying to accomplish a attribute and term list on the shop page using the hook woocommerce_shop_loop_item_title . The goal is to get the attribute(s) and term(s) for the product and then to display it like this example: Color: Red, Blue, Green Size: Small, Medium, Large Dimensions: 90*90, 100*100 and 120*120 but without the spaces between the rows. It should "fetch" all the attributes used with the product and the attributes terms. I've tried this but got fatal error. add_action(

Get top level parent product category as body class in WooCommerce

丶灬走出姿态 提交于 2020-05-30 06:09:07
问题 I need to get the TOP level category (not just the parent category) of a subcategory of products in Woocommerce. I have this code to get the parent category id: if (is_subcategory()) { $term = get_queried_object(); $parent_id = $term->parent; } And this one makes $parent_id as a body class: add_filter( 'body_class', 'parent_id_body_class' ); function parent_id_body_class( $classes ) { // add comprehensive text followed by parent id number to the $classes array $term = get_queried_object();

Get top level parent product category as body class in WooCommerce

大城市里の小女人 提交于 2020-05-30 06:08:46
问题 I need to get the TOP level category (not just the parent category) of a subcategory of products in Woocommerce. I have this code to get the parent category id: if (is_subcategory()) { $term = get_queried_object(); $parent_id = $term->parent; } And this one makes $parent_id as a body class: add_filter( 'body_class', 'parent_id_body_class' ); function parent_id_body_class( $classes ) { // add comprehensive text followed by parent id number to the $classes array $term = get_queried_object();

Set “product_visibility” in Woocommerce to “out of stock” from outofstock metadata in _stock_status [closed]

最后都变了- 提交于 2020-05-16 22:00:22
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 16 days ago . In WooCommerce I'm using scraping/import plugin which doesn't recognise and I can't insert outofstock meta based on actual stock in the "product_visibility" taxonomy. The thing is, that all out of stock products are hidden when the stock status is Out of stock , but products are still counted in the

Hide product price and disable add to cart for specific product categories in Woocommerce

谁都会走 提交于 2020-05-13 07:06:43
问题 I'm looking for the right code that hides the prices for some specific categories in Woocommerce. I already have the code to hide the prices on de single product page: add_action( 'wp', 'remove_prices_based_on_category' ); function remove_prices_based_on_category() { // On product single pages if ( is_product() ) { remove_product_price( get_the_ID() ); } } function return_custom_price( $price, $instance ) { $price = '<span style="color:red; font-size:12px;">Call our office <strong>516.695

Hide product price and disable add to cart for specific product categories in Woocommerce

£可爱£侵袭症+ 提交于 2020-05-13 07:05:35
问题 I'm looking for the right code that hides the prices for some specific categories in Woocommerce. I already have the code to hide the prices on de single product page: add_action( 'wp', 'remove_prices_based_on_category' ); function remove_prices_based_on_category() { // On product single pages if ( is_product() ) { remove_product_price( get_the_ID() ); } } function return_custom_price( $price, $instance ) { $price = '<span style="color:red; font-size:12px;">Call our office <strong>516.695

How to remove classes added to Woocommerce li.product?

我们两清 提交于 2020-03-05 04:07:51
问题 Woocommerce adds the assigned product categories and attributes as custom classes to li.product <li class="post-120 product type-product status-publish has-post-thumbnail category1 category2 category3 category4 pa_one pa_two..."> We have assigned quite a lot of categories to each product and it slows down the site. Is there a way to remove those additional classes? 回答1: If you know php, You can edit the woocoommerce php template file to remove those additional classes. If you opened the file,