Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterHi!
This should do the trick:
[code]//*ADD SEARCH TO HEADER RIGHT MENU
add_filter( ‘wp_nav_menu_items’, ‘theme_menu_extras’, 10, 2 );function theme_menu_extras( $menu, $args ) {
if ( ‘header’ !== $args->theme_location )
return $menu;$menu .= ‘<li class="right search">’ . do_shortcode(‘wpdreams_ajaxsearchpro id=1’) . ‘</li>’;
return $menu;
}[/code]
Ernest Marcinko
KeymasterNice, thanks.
Ernest Marcinko
KeymasterCould you please upload the file again? It seems like there might be a problem with the file uploader on the ticket page, sorry about that.
Ernest Marcinko
KeymasterYour welcome.
1. Very soon, I’m gathering bug reports for a few days for version 4.0, then most likely the second half of the next week I will release a bugfixed version.
2. Yes, it was also a bug.
March 20, 2015 at 2:03 pm in reply to: Styling help required please to look like the dev version #4291Ernest Marcinko
KeymasterSure. I suggest you open another ticket (or you can use this one as well), and upload a txt file with the login details and everything needed. It’s safe, not accessible to anyone else but me and you. (ticket owner)
Ernest Marcinko
KeymasterHi!
Yes it is actually. The search can’t show the term images, as there is no such thing by default in wordpress.
However it is possible to add a few lines of code to your themes functions.php file, which will try to parse images for woocommerce terms:[code]add_filter(‘asp_results’, ‘asp_get_woo_term_image’);
function asp_get_woo_term_image($results) {
foreach($results as $k => $result) {
if ($result->content_type != ‘term’) continue;
if (function_exists(‘get_woocommerce_term_meta’) && empty($result->image)) {
$thumbnail_id = get_woocommerce_term_meta( $result->id, ‘thumbnail_id’, true );
$image = wp_get_attachment_url( $thumbnail_id );
if (!empty($image))
$results[$k]->image = $image;
}
}
return $results;
} [/code]This filtering function will parse through the results, and if it finds a woocommerce term image, it will attach it to the actual result. This solution is update ready, since you do not need to modify the search code.
Ernest Marcinko
KeymasterHi!
The error is coming from another plugin, based on the error message:
/home/fitnessz/public_html/wp-content/plugins/sabai/lib/Sabai.phpSabai directory is that plugin I’m guessing?
Try to deactiavate that plugin temporary and try again. You will most likely see this error message if you will try to activate any other plugin as well, as there is no reference to the ajax search pro in the error message.March 20, 2015 at 12:28 pm in reply to: Cant see all custom fields in the Search in custom fields box #4285Ernest Marcinko
KeymasterHi!
It’s limited to 300 in the current version (it’s because this one time I’ve seen a site with 102 thousand custom fields and the search options didn’t show up at all…)
You can easily break this limit, by opening up the wp-content/plugins/ajax-search-pro/backend/settings/class/customfields.class.php file and go to line 17, where you should see this:
[code]$this->types = $wpdb->get_results("SELECT * FROM " . $wpdb->postmeta . " GROUP BY meta_key LIMIT 300", ARRAY_A);[/code]change that line to:
[code]$this->types = $wpdb->get_results("SELECT * FROM " . $wpdb->postmeta . " GROUP BY meta_key LIMIT 30000", ARRAY_A);[/code]
Now the limit is increased to 30 thousand, so it will most likely show anything. (except if you have more than 30k custom fields)
Ernest Marcinko
KeymasterHi!
Thank you for the observation! It’s actually a work in progress. Some classes are renamed in the latest version (4.0). I didn’t do a full rework on this yet, because there were some extreme changes in the dynamic CSS generator script, and it might have caused too many bugs for testing.
I hope for the upcoming version I’ll finally be able to replace all the remaining classes with the “asp_” prefix.
The main priority for this version was to increase the CSS specificity and an option for the user to change compatibility levels to preserve bandwidth.
When I first saw CSS declarations in best-seller themes like:
[html]#top input {
margin: 10px;
}[/html]
I was speechless. It killed the margins for the search input fields, which were placed into the top element. I’m all in for using classes only in CSS, but codes like this just makes it impossible. There is no way of overriding this with classes only (except for !important, but that’s not an option here).
It took me a few days to put together a robust script to bypass these issues. I whish themeforest had a policy to only allow using class names in themes, or disallowing using ID’s and generics in the same line of CSS code.Ernest Marcinko
KeymasterHi again!
I’ve actually found a bug in the code, that’s why it showed the product from the wrong category. It was a very rare bug, that’s why I didn’t know about it. Thank you for the ftp details, it helps me to discover such bugs. I’m adding this to the next bugfix version.
I have also made a few tweaks:
– I have switched the image handler to BFI thumb on the Compatibility Settings submenu – it’s faster a bit than the other one
– I have disabled the Search in Terms option. The performance went up from 2 seconds to 0.09 seconds!! It’s very performance consuming if you have lot’s of products 😉 It also gives more accurate results if disabled. You can of course switch it back if you want to. (General Options->Sources, bottom of the page)About the “fender combo” search term. Currently I get the following results: http://i.imgur.com/mwxGNp6.png
There is one odd result, the Vox amPlug, but it’s there because it’s content contains both the “fender” and “combo” words: http://i.imgur.com/XjSV9lE.png
You can try to use the “AND with exact keyword mathces” for keyword logic, it will show more strict results – but be aware that partial results then will not appear.
Everything else looks all right.
Ernest Marcinko
KeymasterHi!
It’s because the grouped results structure is a bit different. I quickly put together a working snippet on how to handle grouped and non grouped results:
[code]
add_filter(‘asp_results’,’filter_asp_results’);
function filter_asp_results($results){/* If the results are grouped */
if (isset($results[‘grouped’])) {
foreach ($results[‘items’] as $i_k=>$data) {
if ($i_k == ‘name’) continue;// $result[‘data’] holds the results here
foreach($results[‘items’][$i_k][‘data’] as $r_k=>$res) {
// let’s make it easier to access a result
$result = &$results[‘items’][$i_k][‘data’][$r_k];// changes are need to be made to the $result variable to take effect here
$result->title = "xyz"; //test example/* Your code here */
}
}
/**
* You need to return the $results variable here,
* since the changes are made directly
**/
return $results;/* Non-grouped */
} else {
foreach($results as $k => $result) {
$result = &$results[$k];
$result->title = "xyz"; //test example
/* Your code here */
}
}
}
[/code]I think if you read through the comments you will understand 😉
Let me know if you need more help!Ernest Marcinko
KeymasterI suppose that some of the fields might contain both the “fender” and the “combo” keywords (or parts of it), I’m suspecting the description.
I will however check your configuration just in case. I’ve uploaded my current IP address in text document, but it changes everytime if my connection stops, unfortunately it’s not static.
Ernest Marcinko
KeymasterYes, the priority is a global thing, it applies to every search instance and every search term.
Results with the same priority are sorted by relevance.
So based on your example, I would set the relevances of products for each brand as following:
SPX – 500
Waukesha – 450
APV – 400
Alfa Laval – 350
Graco – 300
Murzan – 250So there is a 50 point gap between each brands. That 50 point reserve is useful if you want to place some products higher inside a brand. So if you want to push higher a Waukesha product, you can set it’s priority to 451, so it’s top of it’s brand, but the SPX products will still stay higher.
You can use of course bigger numbers with bigger gaps, it will still work.
Ernest Marcinko
KeymasterOh, I see the problem now. The cache is not automatically cleared after changing the priorities. I recall disabling that intentionally for some reason. I forgot to add this to the documentation.
If you clear the cache on the Cache Settings submenu after making the changes on with the priorities, the results will appear in the correct order.
Ernest Marcinko
KeymasterIt’s not working for me, the ajax response contains this error message:
Warning: require_once(/nas/wp/www/staging/harvillind/wp-content/plugins/ajax-search-pro//includes/imagecache.class.php): failed to open stream: No such file or directory in /nas/wp/www/staging/harvillind/wp-content/plugins/ajax-search-pro/search.php on line 11
Fatal error: require_once(): Failed opening required ‘/nas/wp/www/staging/harvillind/wp-content/plugins/ajax-search-pro//includes/imagecache.class.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /nas/wp/www/staging/harvillind/wp-content/plugins/ajax-search-pro/search.php on line 11
That means ajax-search-pro/includes/imagecache.class.php is missing. (and possibly other files as well) The search won’t work properly until all the files are there.
-
AuthorPosts