mvereijken
Forum Replies Created
-
@missveronicatv the meta_key I use: location_country
Unfortunately, this causes the filter options to no longer work properly. All cities are now shown instead of the cities within the selected country. I have tried to convert the PHP function in such a way that all cities are always shown within WP-admin, but unfortunately without success. Could a plugin maker advise me on how to fix this?
Update: It seems that disabling setting ‘parent option’ in the city custom field fixes the problems. Is there a downside to deactivating this setting?
Do you mean that only options are shown that have results?
I don’t think this is the problem as it works correctly in the frontend filters and when registering. In addition, there are various accounts that are linked to, for example, Amsterdam
Thanks for clarifying!
Given the urgency of this bug, I don’t want to rely too much on cooperation from the translation plugin support. For that reason I have just tried to make the necessary adjustments myself. The code I added is based on the LiteSpeed guidelines and can be found below:
functions.php
add_action( 'init', 'weglot_set_language_cookie', 1 ); function weglot_set_language_cookie() { if( function_exists("weglot_get_current_language") ) { $lang = weglot_get_current_language() ? weglot_get_current_language() : 'nl'; } else { $lang = "nl"; } setcookie( 'weglot_lang', $lang, time() + ( 30 * DAY_IN_SECONDS ), "/", ); }
.htaccess
<IfModule LiteSpeed> X-LiteSpeed-Vary: cookie=weglot_lang </IfModule>
What strikes me is that setting the cookie seems to go well in all cases. Even when the base language content is shown. See screenshot: https://snipboard.io/sw5kX6.jpg
The fact that base language content is still displayed can mean two things:
a) The cache vary is not properly implemented yet
b) The cache vary only takes effect after emptying the entire website cache (I’d rather avoid this)It would mean a lot if you could support again!
- This reply was modified 2 years ago by mvereijken.
- This reply was modified 2 years ago by mvereijken.
@serpentdriver Thanks for helping out!
Another question regarding your comment:
Is it possible to set this cookie within the theme (using something like https://developers.weglot.com/wordpress/helpers-functions#weglot_get_current_language) or does it need to be set within the translation plugin itself?
As soon as I have this clear, I can choose to install it myself or contact Weglot.
@serpentdriver Thank you for your contribution!
Could you tell me more about this solution and where I can set it up?
Thanks in advance
Forum: Plugins
In reply to: [Advanced AJAX Product Filters] Get available filters programmaticallyI’m aware that I can add this with custom coding but I don’t want to add these buttons hardcoded. This would mean that the buttons are always shown. Since the filter options in the sidebar will disappear if the filter is not available for the current selection this will result in a bad user experience.
That’s why I need to dynamically get the available filters as soon as a user loads the page or updates the filter settings. I could use javascript to check which options are shown in the sidebar but this doesn’t feel like the right approach. That’s why I’m hoping to use one of your functions/filters to dynamically get the available filters.
Forum: Plugins
In reply to: [Advanced AJAX Product Filters] Get available filters programmaticallyThat’s very strange. Maybe you can access https://duux.com/store/ (the Dutch version of the webshop)
The way the filters need to be shown indeed looks like your example but we don’t want a dropdown to appear for each filter but want the filter options to be shown in one global off-canvas modal.
If you click on one of the rounded gray buttons (that say ‘Kleur’, ‘Prijs’ or ‘Ruimte’) on https://xd.adobe.com/view/3fdfc1ef-6bd1-408e-89e8-ee4207447c4b-6a8c/?fullscreen you’ll understand what I mean.
Forum: Plugins
In reply to: [Advanced AJAX Product Filters] Get available filters programmaticallyHi Dima,
An interactive prototype of what we want to achieve can be found at https://xd.adobe.com/view/3fdfc1ef-6bd1-408e-89e8-ee4207447c4b-6a8c/?fullscreen
If you compare it to https://duux.com/en/store you’ll notice the way the filters can be reached is changed by showing all filter options instead of one global filters button.
This is the part I need help with since these buttons need to be dynamic based on if the filter is shown for the current results.
I hope this makes sense to you, but don’t hesitate to ask any more questions!
Forum: Plugins
In reply to: [Advanced AJAX Product Filters] Programmatically set price rangeHi Razy, thank you for the quick reply. I tried updating the values of the range slider for both slider variants but although I manage to visually adjust the values, they are not included when updating the filter results. My code will automatically update the results after setting the right slider values. Since the filters are automatically refreshed after doing this I mainly care about passing on the changes to your plugin so that the url is correctly adjusted and the results are based on this url. Is there any way I can achieve this without having to reload the page?
Alternatively, Is it possible to display a range slider filter twice on one page?