{"id":101457,"date":"2021-08-05T00:43:55","date_gmt":"2021-08-04T19:13:55","guid":{"rendered":"https:\/\/git-staging.wpastra.com\/?post_type=docs&#038;p=101457"},"modified":"2022-11-25T12:48:12","modified_gmt":"2022-11-25T07:18:12","slug":"restrict-search-results-products","status":"publish","type":"docs","link":"https:\/\/git-staging.wpastra.com\/es\/docs\/restrict-search-results-products\/","title":{"rendered":"Restringir los resultados de b\u00fasqueda s\u00f3lo a productos WooCommerce"},"content":{"rendered":"<p>Por defecto, cuando los visitantes utilizan la opci\u00f3n Buscar en su sitio web, los resultados mostrar\u00e1n entradas, p\u00e1ginas, productos, etc. que se ajusten al t\u00e9rmino buscado. <\/p>\n\n\n\n<p>Si tienes una tienda online, quiz\u00e1s quieras limitar la b\u00fasqueda s\u00f3lo a los productos de WooCommerce. Esto puede ayudar a los usuarios a encontrar productos m\u00e1s r\u00e1pido y aumentar la tasa de conversi\u00f3n en tu sitio web. <\/p>\n\n\n\n<p>Para ello, deber\u00e1 a\u00f1adir el siguiente filtro al archivo functions.php de su tema hijo:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">add_filter( 'get_search_form', 'astra_get_search_form_callback' );\nfunction astra_get_search_form_callback( $search_form ) {\n\t$search_form = str_replace( '-1\"&gt;', '-1\"\/&gt;', $search_form );\n\treturn $search_form;\n}<\/pre>\n\n\n\n<p> Si no tiene instalado el tema infantil, compruebe lo siguiente <a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/install-astra-child-theme\/\">este art\u00edculo<\/a> sobre c\u00f3mo hacerlo. <\/p>\n\n\n\n<p>Si no est\u00e1 seguro de c\u00f3mo a\u00f1adir este c\u00f3digo, consulte lo siguiente <a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/add-custom-php-code\/#3.-in-child-theme\">art\u00edculo<\/a>. <\/p>\n\n\n\n<p><strong>*** Nota ***<\/strong><\/p>\n\n\n\n<p>1. El filtro anterior <strong>no funciona <\/strong>para la b\u00fasqueda en la portada. Cuadro de b\u00fasqueda y b\u00fasqueda a pantalla completa. <br>2. En <strong>funciona<\/strong> con la b\u00fasqueda de diapositivas utilizando el elemento de b\u00fasqueda del constructor de cabecera. Consulte el v\u00eddeo adjunto para una mejor comprensi\u00f3n.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2022\/11\/ezgif-4-6f209f1941.gif\"><img fetchpriority=\"high\" decoding=\"async\" width=\"600\" height=\"281\" src=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2022\/11\/ezgif-4-6f209f1941.gif\" alt=\"\" class=\"wp-image-141017\"\/><\/a><\/figure>\n\n\n\n<p>3. En <strong>funciona <\/strong>con el cuadro de b\u00fasqueda mediante la sustituci\u00f3n de la b\u00fasqueda Astra en la cabecera con el widget de b\u00fasqueda WooCommerce. Consulte el v\u00eddeo adjunto para una mejor comprensi\u00f3n.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2022\/11\/woocom-search.gif\"><img decoding=\"async\" width=\"600\" height=\"281\" src=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2022\/11\/woocom-search.gif\" alt=\"\" class=\"wp-image-141027\"\/><\/a><\/figure>","protected":false},"excerpt":{"rendered":"<p>Por defecto, cuando los visitantes utilizan la opci\u00f3n Buscar en tu sitio web, los resultados mostrar\u00e1n entradas, p\u00e1ginas, productos, etc. que se ajusten al t\u00e9rmino buscado. Si tienes una tienda online, quiz\u00e1s quieras limitar la b\u00fasqueda s\u00f3lo a los productos de WooCommerce. Esto puede ayudar a los usuarios a encontrar productos m\u00e1s r\u00e1pido y aumentar la tasa de conversi\u00f3n en tu [...]<\/p>","protected":false},"author":70,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"docs_category":[2112],"docs_tag":[],"class_list":{"0":"post-101457","1":"docs","2":"type-docs","3":"status-publish","5":"docs_category-woocommerce-filters"},"spectra_custom_meta":{"wp_last_modified_info":["November 25, 2022 @ 12:48 PM"],"wplmi_shortcode":["[lmt-post-modified-info]"],"_edit_lock":["1684219896:89"],"_edit_last":["89"],"tap_disable_autolinker":["no"],"tap_autolink_inside_heading":["global"],"tap_autolink_random_placement":["global"],"tap_post_autolinker_limit":["0"],"site-sidebar-layout":["default"],"site-content-layout":["default"],"theme-transparent-header-meta":["default"],"_yoast_wpseo_content_score":["90"],"_yoast_wpseo_estimated-reading-time-minutes":["1"],"views":["6245"],"helpful":["4"],"unhelpful":["14"],"redirects":["10"],"_yoast_wpseo_focuskw":["search WooCommece products only"],"_yoast_wpseo_metadesc":["Do you need to limit search on your store to WooCommerce Products only? Learn how to do this using the custom code provide in this document."],"_yoast_wpseo_linkdex":["46"],"_lmt_disableupdate":["no"],"_wplmi_last_modified":["2022-11-25 12:48:12"],"rank_math_description":["Do you need to limit search on your store to WooCommerce Products only? Learn how to do this using the custom code provide in this document."],"rank_math_focus_keyword":["search WooCommece products only"],"rank_math_news_sitemap_robots":["index"],"rank_math_robots":["a:1:{i:0;s:5:\"index\";}"],"rank_math_analytic_object_id":["163"],"rank_math_internal_links_processed":["1"],"rank_math_primary_docs_category":["2112"],"rank_math_seo_score":["17"],"_oembed_32825e2ee599949c180a51deb6bb3b0a":["{{unknown}}"],"_oembed_6f09a4c01d98538ecc19a273039347c8":["{{unknown}}"],"pfd_related_docs":[""],"rank_math_og_content_image":["a:2:{s:5:\"check\";s:32:\"1ad6f831158c91b4b0068b0e70b6f98f\";s:6:\"images\";a:1:{i:0;i:141017;}}"],"_trp_automatically_translated_slug_es_ES":["restringir-los-resultados-de-busqueda-de-productos"],"_uag_page_assets":["a:9:{s:3:\"css\";s:2495:\".wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape-top svg{width: calc( 100% + 1.3px );}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape.uagb-container__shape-top .uagb-container__shape-fill{fill: rgba(51,51,51,1);}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape-bottom svg{width: calc( 100% + 1.3px );}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape.uagb-container__shape-bottom .uagb-container__shape-fill{fill: rgba(51,51,51,1);}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__video-wrap video{opacity: 1;}.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{max-width: 100%;width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 1200px);max-width: var(--inner-content-custom-width);width: 100%;flex-direction: column;align-items: center;justify-content: center;flex-wrap: nowrap;row-gap: 0px;column-gap: 0px;}.wp-block-uagb-container.uagb-block-debf2792{box-shadow: 0px 0px   #00000070 ;padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;overflow: visible;border-color: inherit;row-gap: 0px;column-gap: 0px;}@media only screen and (max-width: 976px) {.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 1024px);max-width: var(--inner-content-custom-width);width: 100%;}.wp-block-uagb-container.uagb-block-debf2792{padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;}}@media only screen and (max-width: 767px) {.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{max-width: 100%;width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 767px);max-width: var(--inner-content-custom-width);width: 100%;flex-wrap: wrap;}.wp-block-uagb-container.uagb-block-debf2792{padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;}}\";s:2:\"js\";s:0:\"\";s:18:\"current_block_list\";a:5:{i:0;s:14:\"core\/paragraph\";i:1;s:17:\"core\/preformatted\";i:2;s:10:\"core\/image\";i:3;s:14:\"uagb\/container\";i:4;s:14:\"core\/shortcode\";}s:8:\"uag_flag\";b:1;s:11:\"uag_version\";s:10:\"1776953806\";s:6:\"gfonts\";a:0:{}s:10:\"gfonts_url\";s:0:\"\";s:12:\"gfonts_files\";a:0:{}s:14:\"uag_faq_layout\";b:0;}"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false},"uagb_author_info":{"display_name":"Nikola Mihajlovic","author_link":"https:\/\/git-staging.wpastra.com\/es\/author\/nikolam\/"},"uagb_comment_info":0,"uagb_excerpt":"By default, when visitors use the Search option on your website, the results will show posts, pages, products, etc. that fit the term searched. If you&#8217;re running an online store, you might want to limit the search only to WooCommerce products. This can help users find products faster and increase the conversion rate on your&hellip;","_links":{"self":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs\/101457"}],"collection":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/comments?post=101457"}],"version-history":[{"count":0,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs\/101457\/revisions"}],"wp:attachment":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/media?parent=101457"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs_category?post=101457"},{"taxonomy":"docs_tag","embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs_tag?post=101457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}