I am trying to replace checkboxes from custom filter with buttons so it is more aesthetically pleasing, using javascript i have created buttons that replace each checkboxes. Buttons are working(when button is pressed checkbox is checked)
However, i am having trouble retrieving value %%COUNT%% from custom search filter.
I have managed to hide checkbox with CSS code:
input[type="checkbox"] {
display: none;
}
But dont know code to hide label from those checkboxes.
I am providing you with pictures of everything so it should be easier to understand.
Hello. Thank you for contacting the Toolset support.
If you can check with the following screenshot you shared - on right sidebar you can see the section "FORMAT OF THE OPTIONS" from that section you should only set to display %%NAME%% and remove the (%%COUNT%%)
-https://toolset.com/wp-content/uploads/2023/12/2672253-Custom_filter_block.jpg
Can you please share problem URL and admin access details and let me review and check if I able to find any possible workaround.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
adding button in the section "FORMAT OF THE OPTIONS" does not work, when i click checkbox is not checked, so i removed it now so there is no confusion.
Instead those buttons should be created in javascript, I added custom javascript code in the JS editor of that template.
I am providing you with picture of js editor.
In that js code i am able to retrieve value from checkbox and create buttons that work, but i cant retrieve (%%COUNT%%) value and add it as well as the value box(in my case i am able to retrieve Indica,Sativa,Hybrid but not (45),(104),(51)).
I got it now what you want and there is no easy way to achieve this.
You may need to add more custom JS code in order to get the count value. Count value is added as label text so you will have to split the label text with maybe ( (bracket symbol) and try to get the closest label and based on that closest label test you should try to get the label text and split the label text with ( bracket and get the count.
This is just idea if you have better solution with JS you should go with that. Unfortunately - to help with such custom javascript edits is beyond the scope of our support policy. If you need further help for such custom programming you are welcome to contact any of our certified partner:
- https://toolset.com/contractors/