taxonomy-terms

Hide some shipping rates based on taxonomy terms in WooCommerce 4.8+

旧巷老猫 提交于 2021-01-28 18:26:10
问题 I use this to unset shipping for product with specific tag: function specific_products_shipping_methods( $rates, $package ){ // etiquette cocolis $terms = array( 'cocolis' ); $taxonomy = 'product_tag'; foreach( $package['contents'] as $cart_item ) { if ( has_term( $terms, $taxonomy, $cart_item['product_id'] ) ) { unset( $rates['oik_weight_zone_shipping_49'] ); unset( $rates['chrono10'] ); unset( $rates['chrono13'] ); add_filter('woocommerce_shipping_chosen_method', 'reset_default_shipping

Add a prefix to WooCommerce product titles based on categories

让人想犯罪 __ 提交于 2021-01-28 14:00:26
问题 Is there any chance to have a prefix title for specific categories of woocommerce products? For example: If I add an RTX 2080Ti to GPU Category the title needs to be [GPU] RTX 2080Ti. I have tried many codes around the internet but couldn't reach my target. add_filter('wp_title', 'WPSE_20181106_prepend_title', 10, 3); function WPSE_20181106_prepend_title($title, $sep, $seplocation) { // not a single post if (!is_singular('post')) { return $title; } // IDs of categories that should prepend the

Add a prefix to WooCommerce product titles based on categories

ぐ巨炮叔叔 提交于 2021-01-28 13:58:22
问题 Is there any chance to have a prefix title for specific categories of woocommerce products? For example: If I add an RTX 2080Ti to GPU Category the title needs to be [GPU] RTX 2080Ti. I have tried many codes around the internet but couldn't reach my target. add_filter('wp_title', 'WPSE_20181106_prepend_title', 10, 3); function WPSE_20181106_prepend_title($title, $sep, $seplocation) { // not a single post if (!is_singular('post')) { return $title; } // IDs of categories that should prepend the

Discount based on item quantity count for a category in WooCommerce cart

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-28 10:05:48
问题 I have a category of products that are all priced at $15. When the user buys between 10 & 20 products from this category they should receive a discounted price of $10. When the user buys 20+ the price changes again to $5. The user cannot have a custom role assigned to them (like wholesaler). I created code loosely based on LoicTheAztec code from another question and added my own modifications and code. It looks like it should work. I receive no errors but it does not work. add_action(

Discount based on item quantity count for a category in WooCommerce cart

大城市里の小女人 提交于 2021-01-28 10:01:55
问题 I have a category of products that are all priced at $15. When the user buys between 10 & 20 products from this category they should receive a discounted price of $10. When the user buys 20+ the price changes again to $5. The user cannot have a custom role assigned to them (like wholesaler). I created code loosely based on LoicTheAztec code from another question and added my own modifications and code. It looks like it should work. I receive no errors but it does not work. add_action(

Get the subcategories of the current product category in Woocommerce archives [closed]

喜夏-厌秋 提交于 2020-12-13 03:18:13
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . Improve this question I'm trying to Show subcategories (not subsubcategories,etc) under current category in Woocommerce like this Web: http://www.qs-adhesivos.es/app/productos/productos.asp?idioma=en For Example, Construction is the category, and Sealants & adhesives, waterproofing,

Display variation stock status on single dropdown variable products in Wocommerce 3 [closed]

为君一笑 提交于 2020-12-13 03:17:13
问题 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 16 days ago . Improve this question I am using Show stock status next to each attribute value in WooCommerce variable products answer code to display the variation stock status on single product attribute dropdown for variable product pages. This works fine, but take too much time to load a product. How could I

Get the subcategories of the current product category in Woocommerce archives [closed]

萝らか妹 提交于 2020-12-13 03:16:17
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . Improve this question I'm trying to Show subcategories (not subsubcategories,etc) under current category in Woocommerce like this Web: http://www.qs-adhesivos.es/app/productos/productos.asp?idioma=en For Example, Construction is the category, and Sealants & adhesives, waterproofing,