This topic has 27 replies, 2 voices, and was last updated 7 years, 2 months ago ago by Olga Barlow
Hello,
I get an error when I’m using the search. Please check in private content.
THANKS!
Hello,
Problem caused by compatibility with premium version of woocommerce-wholesale-prices plugin. Seems it changes the results of the search page and causes the issue. Once we disable plugin everything works fine.
Regards
Thank you. I will contact plugin authors.
You are welcome!
Regards
Hi olga/ 8theme Team,
I talked to the plugin authors. I got that answer after investigating the bug:
“Hi,
Thanks for keeping in touch!
I apologize for the late reply. I’ve visited your website and it seems there’s a conflict with your theme. I’ve tried to switch the theme to Twenty Seventeen and the search results show no error. Could you please also contact the theme support regarding this matter? It’ll be great if they can also help us identify the issue.
Please let me know how it goes. Looking forward to your reply 🙂
Best Regards
— Harry Moyles
Support
Wholesale Suite <support@wholesalesuiteplugin.com>
”
I know that errors are only show up in the latest versions of the theme. In the beginning there were not such an error.
Thank you for your support.
Best!
Hello,
We added search by SKU and made fixes to show the search results in the correct way without duplicating products. As I told you before looks like that plugin also replaces the results of the search page by their own results and that’s why it conflicts with the theme. We are ready to check their solution if they have tips how to avoid it but keep the correct work of theme search features. The plugin works fine with default theme because default theme does not have any additional options for search.
Regards
Hi Olga, the plugin authors found the problem. Would you please fix this in your next theme release? Would be great!
…
Thanks for sharing the theme files.
Okky here, support level two who will help you with this issue. Harry asked me to check this and see if there’s anything we can do.
I’ve just checked the theme and it seems they use the “posts_clauses” hooks to modify the product search query. Please keep in mind that using “posts_clauses” is not recommended to modify the query as stated in the WordPress documentation here https://codex.wordpress.org/Plugin_API/Filter_Reference/posts_clauses:
The posts_clauses filter runs before the query gets executed and is essentially the sum of all filters that run immediately before it. So it should be used if you don’t intend to let another plugin override it, or if you need to alter several different parts of the query at once.
The problem is that your theme has this code in “wp-content/themes/xstore-responsive-woocommerce-theme-wordpress-theme/xstore/framework/theme-functions.php” on line 824:
$pieces[‘join’] .= “JOIN $wpdb->postmeta on $wpdb->posts.ID = $wpdb->postmeta.post_id”;
Because it’s coded to add the JOIN query instead of replacing it, it produces multiple JOINs in the query:
JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )JOIN wp_postmeta on wp_posts.ID = wp_postmeta.post_id
For now, I suggest to change the code to this one:
$pieces[‘join’] = “JOIN $wpdb->postmeta on $wpdb->posts.ID = $wpdb->postmeta.post_id”;
Also, please ask the theme author to use the “pre_get_posts” filter instead of the “posts_clauses” if they only need to modify the meta query.
I hope this helps 🙂
Thanks,
Okky
— Development Team
Support
WholesaleSuite – WooCommerce plugins that help you sell to wholesale customers
…
Hello,
OK. I passed this to developers.
I’ll inform you on Monday about the results.
Regards
hello Olga,
do you have some updates for me? Thank you!
Hello,
Sorry for the delay in answering. Our developers made some improvements. Could you provide me FTP and admin panel access to check if it works fine with that plugin?
Regards
Hello Olga,
find the login credentials attached.
Are youre changes update save? So I can get the next xtore update?
Please tell me when all is done.
THANK YOU for all your effort!
Hello,
We have made some changes. Try now, please.
Regards
Hi Olga,
thank you but the Blog post search isn’t working. Check link in private content! There are posts with that search phrase.
I never had such problems with WordPress search before.
Thank you :). Great support!
Product search is working like a charme… see link in private content.
Hello,
I don’t see problem with posts search http://prntscr.com/gjtrbq
Could you explain in details?
Regards
Hello Olga,
when Im not logged in and use the search, Products search is working but not post search. Please log out and click on the link in private content…. No posts were shown.
Hello,
Got it. Fixed. Check again, please.
Regards
Hi olga,
sorry. Something must still go wrong. The search doesn’t show Blog posts, it only shows products.
Please check the links in private content….
Hello,
I see that you have 2 WooCommerce Wholesale Prices – premium version and simple http://prntscr.com/gldrgc . Should you keep both enabled? Because once I disable the simple version and only premium version stays then search result page displays posts, pages and products as with default theme. Also, plugin does not allow to show only posts on the results page.
Regards
Hello,
Yes it’s necessary to ise both plugins. Premium is only an addon plugin…
I think there must be still a conflict? Because with other themes it works. :-/.
Dashboard warning says I have to reactivate the plugin…
Hello,
Yes, unfortunately, when you activate plugin it displays only products for the non-logged in users and we can’t find the reason why.
Regards
Maybe can you tell me the changes and I ask the Wholesale Plugin team?
Hello,
Changes were made in searchform.php and functions.php files of the child theme.
Regards
Hello Olga,
when can I remove the searchform.php and the functions.php? Do you will or had integrate that changes in xstore theme?
I’m in contact with the developers of wholesale suite too. They answered: “Yes, we are aware of this issue. Our developers are working on an update that includes the fix for this issue. But currently, we don’t have ETA yet.”…
They provided that code for functions.php:
add_action( 'pre_get_posts' , 'my_wwpp_pre_get_posts', 11);
function my_wwpp_pre_get_posts($query){
if ( ! $query->is_main_query() || isset($_GET['post_type']) ) return;
$query->set( 'meta_query' , array() );
$query->set( 'post_type' , 'post' );
}
But after adding that code I only got 404 errors so I had to remove it…
BEst regards and thank your for the good support. I extended my license today :).
Hi Olga,
the Wholesale Team provided a fix with the last update.
So I removed the changes from functions.php and searchform.php.
Please see hidden content.
Hello,
I’ll send your request to our developers and they will try to implement if it doesn’t break all the other features. Meanwhile, if you want to have the search by all the content you just need to leave customization that we made in child theme.
Regards
You must be logged in to reply to this topic.Log in/Sign up