PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Label or text between attributes list

This support system is for all types of the plugins as for premium versions, so for free ones! If you have premium version do not forget in the private data of the request (!!not in the text of the support request!!) after its publishing insert purchase code please (see blue-green button on the right side) and press Save button.
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello,

is it possible to add a label or a text between some attributes?

Like, if i need to add a text after the first three attributes in list and before the subsequent ones, is it possible?

Thank you.

Hello

You can try this  extension - https://products-filter.com/extencion/sections

OR  use  this  hook  - 'woof_before_draw_filter'

An example:

do_action('woof_before_draw_filter',function( $key, $shortcode_atts){

if($key == 'pa_color'){

echo"Any text";

}

},20,2);

Thank you, either method i think will do the trick.

Just one question: with the"sections" extension, it would be possible to have one section opened by default (i mean when you open the page)? Because if i understand correctly only the title of the section is shown and the section is closed by default.

Thank you!

Hello

with the"sections" extension, it would be possible to have one section opened by default  - Unfortunately no

Ok,

i've tried to insert the hook that you provided in the function.php file of my child theme but it's not working.

Am i missing something?

Thanks

Hello

Please  drop me  wp-admin access - https://share.stackovergo.com/image/i20210618130558.png -> https://share.stackovergo.com/image/i20210618130637.png  I will check  it

I've added wordpress and ftp access (in case you need to modify functions.php file of child theme).

I've removed the hook right now, you can add it directly.

Thank you!

I'm sorry it's my fault. I gave the wrong code

now I pasted this code:

add_action('woof_before_draw_filter',function( $key, $shortcode_atts){
if($key == 'pa_marca'){

echo"<h2>Any text!!!</h2>";

}

},20,2);

 

Result : https://c2n.me/4dEDhu7.png

Thank you very much, this is exaclty what i needed!

The ticket is resolved for me, thanks again.

Welcome;)

I'm sorry to re-open tho topic but i've noticed that the solution that you have proponed is always visible, even if the attribute is not shown in a category.

I'll explain with an example: i have an attribute"size" that is applied on products in category"A" but not on products in category"B". So i see the attribute in the sidebar only if i'm on category page"A". If i add a Label before the attribute"size" via the shortcode that you've provided, i see the label even in category"B" page, even if the corresponding attribute is not visible.

There is a code to add to force the labels to show up only if the corresponding attribute is shown?

Thank you!

Hello

Unfortunately, we do not have a good solution for this.

All I can suggest is text display restrictions by category:

$cat_slug ="slug of the category for which you want to hide the text";

$cat_query ="ID of the category for which you want to hide the text" ."-product_cat";

if($key == 'pa_marca'  &&  ( ! is_product_category($cat_slug) || (iseet($_GET['really_curr_tax']) && $_GET['really_curr_tax'] == $cat_query))){

echo"<h2>Any text!!!</h2>";

}

Thsi will be perfect for me, but i've implemented the code (i have substituted"iseet" with"isset") and the labels are not visible even in the other categories.

This is the code:

$cat_slug ="allestimenti";

$cat_query ="57" ."-product_cat";

add_action('woof_before_draw_filter',function( $key, $shortcode_atts){
if($key == 'pa_segmento-lcv' && ( ! is_product_category($cat_slug) || (isset($_GET['really_curr_tax']) && $_GET['really_curr_tax'] == $cat_query))){

echo"<p>TIPOLOGIA MEZZO</p>";

}

},20,2);

 

Hello

Ok!  Try to move this code - https://share.stackovergo.com/image/i20211203135013.png

Thank you very much, now is working.

Just a last question: i need to hide the labels even on subdirectories of the"allestimenti" category.

Is it possible?

Hello

Please  drop me  a screenshots- what do you want to hide

The code that you've provided is working, but only on one category -->"allestimenti"

Since"allestimenti" have sub-categories, how can i hide the labels in these subcategories?

In the screenshot you can see that the labels are visible in the category"allestimenti" -->"mezzi-con-frigo"

https://tinyurl.com/y5zcwbeu

https://tinyurl.com/yx8tjsx6

Thanks!

Hello

In this case, you need to make this code for each category.

An example(without test)

add_action('woof_before_draw_filter',function( $key, $shortcode_atts){

$cat_slugs =array ("allestimenti","all_slugs", 'all_slags');

$cat_ids = array(57, 58, 59);

$really_curr_tax = false;

if(isset($_GET['really_curr_tax']))

foreach($cat_ids as $id){

$cat_query =$id ."-product_cat";

if(  $_GET['really_curr_tax'] == $cat_query){

$really_curr_tax = true;

}

}

if($key == 'pa_segmento-lcv' && ( ! is_product_category($cat_slugs) || $really_curr_tax )){

echo"<p>TIPOLOGIA MEZZO</p>";

}

},20,2);

Thank you it's working!