{"id":1677389,"date":"2020-09-15T12:47:47","date_gmt":"2020-09-15T12:47:47","guid":{"rendered":"https:\/\/toolset.com\/?post_type=course-lesson&#038;p=1677389"},"modified":"2021-05-18T16:41:46","modified_gmt":"2021-05-18T16:41:46","slug":"creating-a-page-with-a-custom-product-search","status":"publish","type":"course-lesson","link":"https:\/\/toolset.com\/fr\/course-lesson\/creating-a-page-with-a-custom-product-search\/","title":{"rendered":"Creating a Page with a Custom WooCommerce Product Search"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"7dda5bcfcb5803218d5f2b5900e8fd46\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-custom-product-search-1.png\"><img decoding=\"async\" width=\"1241\" height=\"886\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-custom-product-search-1.png\" alt=\"Custom Search for WooCommerce Products created with Toolset\" class=\"wp-image-1770683\" srcset=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-custom-product-search-1.png 1241w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-custom-product-search-1-300x214.png 300w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-custom-product-search-1-1024x731.png 1024w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-custom-product-search-1-150x107.png 150w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-custom-product-search-1-768x548.png 768w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-custom-product-search-1-728x520.png 728w\" sizes=\"auto, (max-width: 1241px) 100vw, 1241px\" \/><\/a><div class=\"tb-image-caption\"><figcaption>Custom Search for WooCommerce Products created with Toolset<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Setting up a page with the search View<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Add a new page.<\/li><li>Insert the <strong>Toolset View<\/strong> block.<\/li><li>In the View-creation wizard, enable the&nbsp;<strong>Search&nbsp;<\/strong>option.<\/li><li>Choose <strong>Products<\/strong> as the type of content this View will display.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Creating the product search form<\/h2>\n\n\n\n<p>In the upper part of your View\u2019s editing area you add filters.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Click on the <strong>Add Search Field<\/strong> button to add filters.<\/li><\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"6143d92563ea1974e2a73a679d93186b\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/adding-filter-to-you-search.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/adding-filter-to-you-search-500x266.png\" alt=\"Adding filters to your product search\" class=\"wp-image-1770661\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Adding filters to your product search<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Use the <strong>Add Search Button<\/strong> to add the submit button which will trigger the searching.<\/li><li>Insert the <strong>Toolset Grid <\/strong>block and drag-and-drop your filters into it to arrange your filters into columns.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Creating search results<\/h2>\n\n\n\n<p>In the bottom part of your View&#8217;s editing area you design your search results.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Insert blocks into the&nbsp;<strong>WordPress Archive Loop<\/strong>&nbsp;area to design a single item of your&nbsp;View loop.<\/li><li>Use the Toolset <strong>Heading <\/strong>and <strong>Single Field<\/strong> blocks with dynamic sources to display your product title, excerpt, custom fields, and taxonomies.<\/li><li>Use blocks from the&nbsp;<strong>Toolset WooCommerce<\/strong> section to insert WooCommerce elements such as the <strong>Add to Cart Button<\/strong>, <strong>Product Price<\/strong>, and more. You will notice that all Toolset WooCommerce blocks allow you to <a href=\"https:\/\/toolset.com\/fr\/course-lesson\/selecting-woocommerce-blocks-output-type\/\">select a custom or native output type<\/a>.<\/li><\/ol>\n\n\n\n<h2 class=\"tb-heading\" data-toolset-blocks-heading=\"8a75f852e429bee91a564c6f9f9d2dbe\" data-last-update=\"1.4\">What else you can do with your product search<\/h2>\n\n\n\n<p>You can enhance your search by:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>styling your filters<\/li><li>adding pagination<\/li><li>making results update on-the-fly using AJAX<\/li><li>setting up the View search and results side by side:<\/li><\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"ad6f38a08dba76758dc6a097f2c5717e\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/product-search.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/product-search-500x372.png\" alt=\"Setting search filers and search results side by side\" class=\"wp-image-1770623\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Setting search filers and search results side by side<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div class=\"tb-fields-and-text\" data-toolset-blocks-fields-and-text=\"360284519b991feb492b582c7d84725f\"><p>For video instructions and more information visit the lesson about <a href=\"https:\/\/toolset.com\/fr\/course-lesson\/creating-a-custom-search\/\">creating a custom search<\/a>.<\/p><\/div>\n","protected":false},"author":4341,"featured_media":1712637,"template":"","related-lesson":[8445],"class_list":["post-1677389","course-lesson","type-course-lesson","status-publish","has-post-thumbnail","hentry","related-lesson-e-commerce"],"_links":{"self":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson\/1677389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson"}],"about":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/types\/course-lesson"}],"author":[{"embeddable":true,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/users\/4341"}],"version-history":[{"count":7,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson\/1677389\/revisions"}],"predecessor-version":[{"id":2060217,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson\/1677389\/revisions\/2060217"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/media\/1712637"}],"wp:attachment":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/media?parent=1677389"}],"wp:term":[{"taxonomy":"related-lesson","embeddable":true,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/related-lesson?post=1677389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}