Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterHi,
Sure! It is possible to do programmatically via the Frontend Filters API.
It highly depends on the exact scenario, but this is the starter code you are looking for:
add_filter('asp_pre_get_front_filters', 'asp_change_a_filter', 10, 2); function asp_change_a_filter($filters, $type) { if ($type == 'taxonomy') { $selected = array( // page id => selected category ID, 1 => 123, 2 => 12344 ); foreach ($filters as $k => &$filter) { // Go through the filter items via a loop foreach ($filter->get() as $kk => $item) { // Should this be selected? if ( isset($selected[get_the_ID()]) && $item->id == $selected[get_the_ID()] ) { $filter->attr($kk, 'selected', true, true); } else { // Unselect the rest $filter->attr($kk, 'selected', false, true); } } } } return $filters; }Unfortunately I could not test this right now, but should be very close to a possible solution.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
August 18, 2023 at 1:28 pm in reply to: Can Search adhere to menu visibility rules or some other visibility logic? #45112Ernest Marcinko
KeymasterHi Bill,
Great!
The reason is, that the index does not update if the post is not saved, so the SKU is not being added to the database. I suggest triggering at least the save_post hook after each item is pushed, so that WordPress can run all the triggers related to that item. It is a best practice, because WordPress and plugins can have some hooks applied to this for maintenance (like Ajax Search Pro), so this way the index is kept up to date.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou are very welcome 🙂
Ernest Marcinko
KeymasterHi Frank,
Thank you very much for the details!
I tried to log-in with the details, but the site immediately locked me out: https://i.imgur.com/tUisJNm.png
Can you please check that?Ernest Marcinko
KeymasterHi James,
Your PHP version is very likely outdated. The error refers to a function type declaration, which was not supported before PHP 7.0. I recommend updating to the latest PHP if possible (8.x), as the minimum stable requirement for WordPress is 7.4 major version. This plugin also follows this requirement.
Updating to 7.4 or later will resolve any issues.Ernest Marcinko
KeymasterHi,
Unfortunately without that the server can’t create an image of the document. Currently ImageMagick is the only reliable way to get PDF images within WordPress.
If you ask the hosting company, then I’m sure they will do the change for you.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
The easyest way to set that up is via a custom field ordering “total_sales” like this: https://i.imgur.com/eQ39oFI.png
That should do the trick 🙂Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts