XStore Search -> WordPress Database error

This topic has 27 replies, 2 voices, and was last updated 6 years, 7 months ago ago by Olga Barlow

  • Avatar: kumapanda
    kumapanda
    Participant
    August 1, 2017 at 12:30

    Hello,

    I get an error when I’m using the search. Please check in private content.

    THANKS!

    Please, contact administrator
    for this information.
    26 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 1, 2017 at 14:58

    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

    Avatar: kumapanda
    kumapanda
    Participant
    August 9, 2017 at 15:43

    Thank you. I will contact plugin authors.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 10, 2017 at 12:52

    You are welcome!

    Regards

    Avatar: kumapanda
    kumapanda
    Participant
    August 16, 2017 at 10:03

    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!

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 16, 2017 at 11:01

    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

    Avatar: kumapanda
    kumapanda
    Participant
    August 21, 2017 at 12:22

    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

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 22, 2017 at 14:03

    Hello,

    OK. I passed this to developers.
    I’ll inform you on Monday about the results.

    Regards

    Avatar: kumapanda
    kumapanda
    Participant
    September 7, 2017 at 14:57

    hello Olga,

    do you have some updates for me? Thank you!

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    September 7, 2017 at 17:48

    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

    Avatar: kumapanda
    kumapanda
    Participant
    September 8, 2017 at 13:19

    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!

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    September 11, 2017 at 09:20

    Hello,

    We have made some changes. Try now, please.

    Regards

    Avatar: kumapanda
    kumapanda
    Participant
    September 11, 2017 at 13:28

    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!

    Please, contact administrator
    for this information.
    Avatar: kumapanda
    kumapanda
    Participant
    September 11, 2017 at 13:29

    Product search is working like a charme… see link in private content.

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    September 11, 2017 at 15:34

    Hello,

    I don’t see problem with posts search http://prntscr.com/gjtrbq
    Could you explain in details?

    Regards

    Avatar: kumapanda
    kumapanda
    Participant
    September 11, 2017 at 16:55

    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.

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    September 14, 2017 at 14:41

    Hello,

    Got it. Fixed. Check again, please.

    Regards

    Avatar: kumapanda
    kumapanda
    Participant
    September 14, 2017 at 15:13

    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….

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    September 15, 2017 at 08:24

    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

    Avatar: kumapanda
    kumapanda
    Participant
    September 15, 2017 at 08:51

    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. :-/.

  • 1 2
    Viewing 20 results - 1 through 20 (of 27 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.