Search gives no results after update and changes made to theme-functions.php
Using WPML.
If I replace
// WooCommerce search query part with old one, it works again.
This topic has 17 replies, 3 voices, and was last updated 2 minutes ago ago by Tony Rodriguez
Search gives no results after update and changes made to theme-functions.php
Using WPML.
If I replace
// WooCommerce search query part with old one, it works again.
Hello, Kristjan,
Could you please provide temporary wp-admin and FTP access? We will check what can be done to help you.
To grant WP-Admin access, please proceed to create a new user account with an administrator role through your WordPress Dashboard. Once the account is established, you may securely transmit the username and password to us via the Private Content section designated for this purpose.
For FTP access, we require the following details: FTP host, FTP username, FTP password, FTP port, and FTP encryption type. If you need assistance in creating these credentials, please reach out to your hosting provider who will guide you through the process.
Best Regards,
8Theme’s Team
The problem was that when the old SKU search code was converted to use prepare(), the SQL structure changed slightly: a closing parenthesis was added too early inside the prepared fragment.
Line 880 should be:
“,
not
)”,
I’d also use
$s = trim( wp_unslash( $wp_the_query->query_vars[‘s’] ?? ” ) );
on line 857
Also your recent patch fixed the SQL grouping issue and improved the SKU search branch by using prepare() and esc_like().
However, the search is still not fully hardened against SQL injection, because the variation search block still concatenates the raw search term into SQL LIKE ‘%$s%’ conditions.
See more info I posted in this topic: https://www.8theme.com/topic/new-sql-injection-vulnerability-discovered/#post-434516
Hello, Kristjan,
The functions wp_unslash() and trim() are not required in this case. The value used here is not the raw data from $_GET, but rather query_vars[‘s’] from the WordPress query object. Therefore, adding an extra wp_unslash() would be redundant and provide no practical benefit.
Similarly, trim() is also unnecessary: the current search logic already works correctly with this value, and forcibly trimming spaces would alter the query’s behavior. In other words, adding wp_unslash() and trim() in this line appears to be excessive data normalization rather than a necessary safeguard or correction.
Best regards,
8Theme’s Team
You still have to remove the )
This breaks the product search with WPML.
The prepared SQL string should be left open since the remaining parentheses are closed later by the appended SQL
$where .= “) )”;
Hello, Kristjan,
We have made the necessary changes to the file wp-content/themes/xstore/framework/theme-functions.php.
These changes will also be included in the next theme update.
Best regards,
The 8Theme Team
Thank you!
You’re most welcome! Wishing you a wonderful day ahead.
We hope our theme is elevating your experience. If you could take a moment to leave us a glowing 5-star review on ThemeForest, it would mean the world to us. Your feedback is incredibly important and helps us continue to improve.
You can rate us here: https://themeforest.net/downloads
Should you have any other questions or require assistance, please don’t hesitate to contact us. Our dedicated support team is always here to help.
Well, latest update still has the same issue.
I just created a new blank site test.hilo.ee
Search works fine without WPML, but with WPML it does not find any product.
Hello, Kristjan,
Could you please provide temporary wp-admin and FTP access? We will check what can be done to help you.
To grant WP-Admin access, please proceed to create a new user account with an administrator role through your WordPress Dashboard. Once the account is established, you may securely transmit the username and password to us via the Private Content section designated for this purpose.
For FTP access, we require the following details: FTP host, FTP username, FTP password, FTP port, and FTP encryption type. If you need assistance in creating these credentials, please reach out to your hosting provider who will guide you through the process.
Best Regards,
8Theme’s Team
Here are the details:
Hello, Kristjan,
We have resolved this issue, and the changes have been added to the file:
wp-content/themes/xstore/framework/theme-functions.php
These changes will also be included in the next theme update.
Best regards,
8Theme Team
Thanks!
Thanks for the support! My topic “Search stopped working after update to 9.7.2” has been successfully resolved.
Dear Kristjan,
We really appreciate your time and engagement within the WordPress & WooCommerce community
Your feedback drives every improvement we make in XStore — helping us deliver a smoother and more flexible experience with each update.
Leave Feedback →
(takes less than a minute)
Your input makes a real difference.
Topic closed.
The 8Theme Team
The issue related to '‘Search stopped working after update to 9.7.2’' has been successfully resolved, and the topic is now closed for further responses