Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search query not taken into account in the woocommerce price filter #12685

Closed
wimvl opened this issue Dec 23, 2016 · 0 comments
Closed

Search query not taken into account in the woocommerce price filter #12685

wimvl opened this issue Dec 23, 2016 · 0 comments

Comments

@wimvl
Copy link

wimvl commented Dec 23, 2016

EXPLANATION OF THE ISSUE

Hi,

The woocommerce price filter is not taking search terms into account.

I solved it by adding the search_query to the sql string in includes/widgets/class-wc-widget-price-filter.php:
So, just before the return, I added:
$s = get_search_query();
if (!empty($s)) {
$s_terms = explode(" ",$s);
$s_where = implode("%') and (post_title like '%",$s_terms);
$sql .= " AND (((post_title like '%".$s_where."%'))";
$s_where = implode("%') and (post_excerpt like '%",$s_terms);
$sql .= " or ((post_excerpt like '%".$s_where."%'))";
$s_where = implode("%') and (post_content like '%",$s_terms);
$sql .= " or ((post_content like '%".$s_where."%')))";
}

So, can you please update this in the standard class?

Thanks,
Wim

STEPS TO REPRODUCE THE ISSUE

Requests like the following will show prices in the filter for all products in the shop:
http://www.cycosports.be/nl/?s=durano&post_type=product

SYSTEM STATUS REPORT

Grab the system status report from WooCommerce > System Status and paste it here.

`

WordPress Environment

Home URL: http://www.cycosports.be
Site URL: http://www.cycosports.be
WC Version: 2.6.9
Log Directory Writable: ✔
WP Version: 4.7
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: nl_NL

Server Environment

Server Info: Apache
PHP Version: ❌ 5.5.38 - Wij raden minimaal PHP-versie 5.6 aan. Bekijk: Hoe je PHP-versie bijwerken
PHP Post Max Size: 16 MB
PHP Time Limit: 30
PHP Max Input Vars: 20000
cURL Version: 7.26.0
OpenSSL/1.0.1t

SUHOSIN Installed: –
MySQL Version: ❌ 5.5.31 - Wij adviseren een minimum PHP-versie 5.6. Bekijk: WordPress Benodigheden
Max Upload Size: 16 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 2.6.9
:
woocommerce_sessions: ✔
woocommerce_api_keys: ✔
woocommerce_attribute_taxonomies: ✔
woocommerce_downloadable_product_permissions: ✔
woocommerce_order_items: ✔
woocommerce_order_itemmeta: ✔
woocommerce_tax_rates: ✔
woocommerce_tax_rate_locations: ✔
woocommerce_shipping_zones: ✔
woocommerce_shipping_zone_locations: ✔
woocommerce_shipping_zone_methods: ✔
woocommerce_payment_tokens: ✔
woocommerce_payment_tokenmeta: ✔
MaxMind GeoIP Database: ✔

Active Plugins (22)

Ajax Load More: door Darren Cooney – 2.13.1
Contact Form 7: door Takayuki Miyoshi – 4.6
Google Analyticator: door SumoMe – 6.5.0.0
Media Library Assistant: door David Lingren
Fair Trade Judaica – 2.40

Nextend Facebook Connect: door Roland Soos – 1.5.9
Nextend Google Connect: door Roland Soos
Jamie Bainbridge – 1.6.0

Polylang: door Frédéric Demarle – 2.0.11
Print Invoice, Packing Slip, Delivery Note & Label Plugin for WooCommerce (Basic): door WooForce – 2.0.9
Regenerate Thumbnails: door Alex Mills (Viper007Bond) – 2.2.6
Ultimate WooCommerce Brands: door MagniumThemes – 1.1.2
Use Administrator Password: door David Anderson – 1.2.2
WC MyParcel Belgium: door Ewout Fernhout – 1.0
Hyyan WooCommerce Polylang Integration: door Hyyan Abo Fakher – 0.29
WooCommerce PayPal Express Checkout Gateway: door Automattic – 1.1.2
WooCommerce Pay for Payment: door Jörn Lund – 1.3.8
Woocommerce Pay.nl Payment Methods: door Pay.nl – 2.5.8
WooCommerce Product Add-ons: door Automattic – 2.7.24
WOOF - WooCommerce Products Filter: door realmag777 – 1.1.6.1
WooCommerce: door WooThemes – 2.6.9
WooSidebars: door WooThemes – 1.4.3
WP Last Login: door Konstantin Obenland – 1.4.0
YITH WooCommerce Wishlist: door YITHEMES – 2.0.16

Settings

Force SSL: –
Currency: EUR (€)
Currency Position: left
Thousand Separator:
Decimal Separator: ,
Number of Decimals: 2

API

API Enabled: ✔

WC Pages

Winkelbasis: #67 - /nl/shop/
Winkelmand: #66 - /nl/cart/
Afrekenen: #65 - /nl/checkout/
Mijn account: #64 - /nl/my-account/

Taxonomies

Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Theme

Name: CyCo
Version: 3.0
Author URL:
Child Theme: ✔
Parent Theme Name: Flatsome
Parent Theme Version: 3.1.6
Parent Theme Author URL: http://www.uxthemes.com/
WooCommerce Support: ✔

Templates

Overrides: flatsome/woocommerce/archive-product.php
flatsome/woocommerce/cart/cart-empty.php
flatsome/woocommerce/cart/cart.php
flatsome/woocommerce/checkout/form-checkout.php
flatsome/woocommerce/checkout/form-coupon.php
flatsome/woocommerce/checkout/thankyou.php
flatsome/woocommerce/content-product.php
flatsome/woocommerce/content-product_cat.php
flatsome/woocommerce/content-single-product.php
flatsome/woocommerce/global/breadcrumb.php
flatsome/woocommerce/global/quantity-input.php
flatsome/woocommerce/global/wrapper-end.php
flatsome/woocommerce/global/wrapper-start.php
flatsome/woocommerce/loop/loop-end.php
flatsome/woocommerce/loop/loop-start.php
flatsome/woocommerce/loop/orderby.php
flatsome/woocommerce/loop/pagination.php
flatsome/woocommerce/loop/result-count.php
flatsome/woocommerce/loop/sale-flash.php
flatsome/woocommerce/myaccount/form-login.php
flatsome/woocommerce/myaccount/navigation.php
flatsome/woocommerce/notices/error.php
flatsome/woocommerce/notices/notice.php
flatsome/woocommerce/notices/success.php
flatsome/product-searchform.php versie - is verlopen. De core versie is 2.5.0
flatsome/woocommerce/single-product/price.php
flatsome/woocommerce/single-product/product-image.php
flatsome/woocommerce/single-product/product-thumbnails.php
flatsome/woocommerce/single-product/related.php
flatsome/woocommerce/single-product/review.php
flatsome/woocommerce/single-product/sale-flash.php
flatsome/woocommerce/single-product/short-description.php
flatsome/woocommerce/single-product/tabs/tabs.php
flatsome/woocommerce/single-product/title.php
flatsome/woocommerce/single-product/up-sells.php
flatsome/woocommerce/single-product-reviews.php
flatsome/woocommerce/single-product.php

: Meer informatie over het bijwerken van verouderde templates
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant