This support ticket is created vor 7 Jahre, 1 Monat. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I have a custom filed (WooCommerce) with mp3 file (name_of_the_file.mp3) with some of the products that does not have an mp3 file assigned to the field (empy).
I am trying to create a filter that will render a check box
e.g
checked >> show only products with an mp3 file
unchecked >>> show all products (with and without mp3)
I think it should switch between empty field vs some_name_in_the_filed.mp3
I have tried most of the options and still don't know how to do it.
Can I have problem URL where you want to put checkbox and temporary access details.
*** 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 would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
Yes - that will work but it will prefilter your results.
I do not able to access wp-admin. What if we add checkbox field as you want and submit button, when user check the checkbox and click on submit button your view result filtered.
No offence but I had to recover my backup and I have removed your access to my wp-admin area and ftp.
Can I ask for someone else to help me with this problem? Please?
I need someone to answer my question in plain English and tell me how to do it and not someone who tries to make it work using php (blah blah blah)
I didn't ask you to customize my php. I only asked you to tell me if it was possible (and how / so I can understand) or not.
It need some custom codes, Views is using wordpress class "WP_Query" to query the posts, you can add a filter in the query, check if the custom field "mp3 file" is "NOT EXISTS", then display those posts do not have a custom field "mp3 file", see wordpress document: https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
meta_compare (string) - Operator to test the 'meta_value'. Possible values are '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN', 'NOT EXISTS' ...
If you need more assistance for it, please provide a database dump file of your website, I can test and debug it in my localhost, and setup an example for you.
There isn't "NOT EXISTS" option in the screenshot you mentioned above, this is a limitation of Views plugin, and as I mentioned above, it need custom PHP codes by adding into your theme/functions.php. please let me know if you need more assistance for it.
You're right. I thought that this could be achieved by using some combination of filtering values.
But it is not - according to what you wrote.
This could be a nice add-on for a future update to the toolset. Don't you think?
Thanks for explanation.
Adam
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.