{"id":1770,"date":"2024-09-26T13:44:50","date_gmt":"2024-09-26T13:44:50","guid":{"rendered":"http:\/\/docs"},"modified":"2024-09-26T13:44:50","modified_gmt":"2024-09-26T13:44:50","password":"","slug":"header-builder-search-filters","status":"publish","type":"docs","link":"https:\/\/www.8theme.com\/documentation\/xstore\/xstore-hooks-filters\/header-builder-search-filters\/","title":{"rendered":"Header Builder Search filters"},"content":{"rendered":"<h4>Filter name: <code class=\"inline-code\">etheme_ajax_search_products_sku<\/code> <\/h4>\n<p>Filter to add product SKU in search Ajax results on products<\/p>\n<p><strong>Filter usage:<\/strong><\/p>\n<pre>add_filter(&#39;etheme_ajax_search_products_sku&#39;, &#39;__return_true&#39;);\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<p>Before -&gt; <\/p>\n<p><img decoding=\"async\"  src=\"https:\/\/s3.amazonaws.com\/helpscout.net\/docs\/assets\/5809d09590336070ba24798e\/images\/65ae73ed98aa997ae831650d\/file-kzf2PajnWG.png\" style=\"width: 100%; max-width: 100%; \" \/><\/p>\n<p>(product SKU is not shown)<\/p>\n<p>After -&gt; <\/p>\n<p><img decoding=\"async\"  src=\"https:\/\/s3.amazonaws.com\/helpscout.net\/docs\/assets\/5809d09590336070ba24798e\/images\/65ae7507bcd27426da814e8a\/file-aeQkJcJHNM.png\" style=\"width: 100%; max-width: 100%; \" \/><\/p>\n<p>(product SKU is shown for each product that has it)<\/p>\n<h4>Filter name: <code class=\"inline-code\">etheme_ajax_search_arrow<\/code> <\/h4>\n<p>Filter to hide arrow on each search result item<\/p>\n<p><b>Filter usage:<\/b><\/p>\n<pre>add_filter(&#39;etheme_ajax_search_arrow&#39;, &#39;__return_false&#39;);\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<p>Before -&gt; <\/p>\n<p><img decoding=\"async\"  src=\"https:\/\/s3.amazonaws.com\/helpscout.net\/docs\/assets\/5809d09590336070ba24798e\/images\/65ae744d33fd8c767f4f8992\/file-mbzZCrrfwX.png\" style=\"width: 100%; max-width: 100%; \" \/><\/p>\n<p>After -&gt; <\/p>\n<p><img decoding=\"async\"  src=\"https:\/\/s3.amazonaws.com\/helpscout.net\/docs\/assets\/5809d09590336070ba24798e\/images\/65ae7465c231e622d44b3a00\/file-nEjaTrwJp1.png\" style=\"width: 100%; max-width: 100%; \" \/><\/p>\n<p>(arrow is not shown)<\/p>\n<p>In some languages, this arrow SVG was shown as a &#39;true&#39; string so this filter hides the arrow and that string is not shown.<\/p>\n<h4>Filter name: <code class=\"inline-code\">etheme_ajax_search_products_query<\/code> <\/h4>\n<p>Filter to modify search products query by own needs<\/p>\n<p><b>Filter usage:<\/b><\/p>\n<pre>add_filter(&#39;etheme_ajax_search_products_query&#39;, function ($args){\n\t$args[&#39;meta_key&#39;] = &#39;_price&#39;;\n\t$args[&#39;orderby&#39;] = &#39;meta_value_num&#39;;\n\t$args[&#39;order&#39;] = &#39;ASC&#39;;\n\treturn $args;\n});\n<\/pre>\n<p><strong>Example:\u00a0<\/strong><\/p>\n<p>Before -&gt; <\/p>\n<p><img decoding=\"async\"  src=\"https:\/\/s3.amazonaws.com\/helpscout.net\/docs\/assets\/5809d09590336070ba24798e\/images\/65ae74a998aa997ae831650e\/file-mWq8n9staO.png\" style=\"width: 100%; max-width: 100%; \" \/><\/p>\n<p>After -&gt;<\/p>\n<p><img decoding=\"async\"  src=\"https:\/\/s3.amazonaws.com\/helpscout.net\/docs\/assets\/5809d09590336070ba24798e\/images\/65ae74ca33fd8c767f4f8995\/file-JPIzMstEn3.png\" style=\"width: 100%; max-width: 100%; \" \/><\/p>\n<p>( products results are sorted by price )\u00a0<\/p>\n<h4>Filter name: <code class=\"inline-code\"><b>etheme_ajax_search_posts_query<\/b><\/code><\/h4>\n<p>Filter to customize the global search query according to your own needs<\/p>\n<p><b>Filter usage:<\/b><\/p>\n<pre>add_filter(&#39;etheme_ajax_search_posts_query&#39;, function ($args){\n\t$args[\u2018relevanssi\u2019] = true;\n\treturn $args;\n});\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Filter name: etheme_ajax_search_products_sku Filter to add product SKU in search Ajax results on products Filter usage: add_filter(&#39;etheme_ajax_search_products_sku&#39;, &#39;__return_true&#39;); Example: Before -&gt; (product SKU is not shown) After -&gt; (product SKU is shown for each product that has it) Filter name: etheme_ajax_search_arrow Filter to hide arrow on each search result item Filter usage: add_filter(&#39;etheme_ajax_search_arrow&#39;, &#39;__return_false&#39;); Example: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"doc_category":[48],"doc_tag":[],"class_list":["post-1770","docs","type-docs","status-publish","hentry","doc_category-xstore-hooks-filters"],"aioseo_notices":[],"year_month":"2026-04","word_count":195,"total_views":"3652","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"author_nicename":"docs","author_url":"https:\/\/www.8theme.com\/documentation\/author\/docs\/"},"doc_category_info":[{"term_name":"XStore Hooks &amp; Filters","term_url":"https:\/\/www.8theme.com\/documentation\/xstore\/xstore-hooks-filters\/"}],"doc_tag_info":[],"author_list":[{"ID":"1","user_login":"docs","display_name":"docs","id":"1"}],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/docs\/1770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/comments?post=1770"}],"version-history":[{"count":0,"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/docs\/1770\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/media?parent=1770"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=1770"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=1770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}