{"id":1688487,"date":"2020-09-15T12:47:48","date_gmt":"2020-09-15T12:47:48","guid":{"rendered":"https:\/\/toolset.com\/?post_type=course-lesson&#038;p=1688487"},"modified":"2020-11-23T06:15:48","modified_gmt":"2020-11-23T06:15:48","slug":"creating-a-custom-list-of-woocommerce-products-for-a-taxonomy","status":"publish","type":"course-lesson","link":"https:\/\/toolset.com\/de\/course-lesson\/creating-a-custom-list-of-woocommerce-products-for-a-taxonomy\/","title":{"rendered":"Creating a Custom List of WooCommerce Products for a Taxonomy"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"b6745cccbc443032b67d85af9e178dbe\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/custom-list-products.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/custom-list-products-500x193.png\" alt=\"Custom list of product belonging to a specific taxonomy term\" class=\"wp-image-1770911\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Custom list of product belonging to a specific taxonomy term<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div class=\"tb-fields-and-text\" data-toolset-blocks-fields-and-text=\"360284519b991feb492b582c7d84725f\"><p>You will learn how to use the View block to display three recent products for women. &#8220;Women&#8221; is one of the terms of a custom taxonomy named &#8220;Department&#8221;. To learn how to categorize products in such way visit the lesson about <a href=\"https:\/\/toolset.com\/de\/course-lesson\/adding-a-custom-taxonomy-to-woocommerce-products\/\">adding a custom taxonomy to WooCommerce Products<\/a>.<\/p><\/div>\n\n\n\n<p>In our example, we will use the product image as a dynamic background and display the product title with a fancy overlay effect. Feel free to create a design of your choice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps for creating a list of products for a taxonomy<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Create a View for&nbsp;<\/strong>displaying products<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Edit or create a page and insert the&nbsp;<strong>View&nbsp;<\/strong>block.<\/li><li>In the View-creation wizard, stick to the default <strong>Grid<\/strong> in the <strong>Select View Loop Style<\/strong>&nbsp;section.<\/li><li>In the last step of the wizard, select&nbsp;<strong>Products<\/strong>&nbsp;as your post type.<\/li><li>In the View Loop, insert a&nbsp;<strong>Container&nbsp;<\/strong>block and set its background to<strong> Image<\/strong>.<\/li><li>Make the image dynamic and link to the post\u2019s featured image.<\/li><li>Inside your <strong>Container <\/strong>block, insert one more <strong>Container <\/strong>block with a solid background set to black.<\/li><li>Insert the <strong>Toolset Heading<\/strong> block inside your inner <strong>Container <\/strong>and set it to the dynamic title as a link.<\/li><\/ol>\n\n\n\n<p>We will improve the styling later.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"741654cda939111ed322b9c315d6a2d9\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/setting-up-custom-view-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/setting-up-custom-view-1-500x266.png\" alt=\"\" class=\"wp-image-1771129\"\/><\/a><div class=\"tb-image-caption\"><figcaption>View block displaying product and its block hierarchy<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Add taxonomy filters to your View<\/strong><\/h3>\n\n\n\n<p>By default, your View will display all products from your site. You can limit the products to products from a specific taxonomy by setting up filters.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"257f7845e6035ffe8d1936b4447607d0\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/filter-for-taxonomy-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/filter-for-taxonomy-1-500x320.png\" alt=\"Filtering a View by a specific taxonomy\" class=\"wp-image-1770965\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Filtering a View by a specific taxonomy<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ol class=\"wp-block-list\"><li>Use the <strong>Block Navigation<\/strong> button to select the main <strong>View <\/strong>block.<\/li><li>In the right-hand sidebar, expand the <strong>Content Selection<\/strong> section.<\/li><li>Add a filter and select your taxonomy in the Taxonomy section.<\/li><li>Check one of your taxonomy terms, i.e. &#8220;Women&#8221;.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Limit the number of products to show<\/h3>\n\n\n\n<p>By default, your View will display all products meeting your filter criteria. Let&#8217;s see how to limit the number of products to the recent three.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Use the <strong>Block Navigation<\/strong> button to select the main&nbsp;<strong>View&nbsp;<\/strong>block.<\/li><li>In the right-hand sidebar expand the <strong>Limit and offset<\/strong> section. Set the number of items to display to 3.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Adjust the styling<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Select the outer <strong>Container<\/strong> block of your View Loop.<ul><li>In the <strong>Additional Settings<\/strong> section, set the left and right paddings to zero.<\/li><li>In the <strong>Inner Content<\/strong> section, set up the <strong>Min-Height<\/strong> setting to 30px and choose the <strong>Vertically Align Bottom<\/strong> option.<\/li><\/ul><\/li><li>Select the inner <strong>Container <\/strong>block of your View Loop.<ul><li>Expand the <strong>Background <\/strong>section, click on the <strong>Custom Color<\/strong>, and in the pop-up that appears use the bottom slider to reduce the opacity.<\/li><\/ul><\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Add WooCommerce fields to your View<\/h3>\n\n\n\n<p>Use blocks from the <strong>Toolset WooCommerce<\/strong> section to insert WooCommerce fields into your Views such as the Product Price, Product Rating, and Add to Cart Button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"445b83364af3679179348bea17e2de64\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-blocks-1.png\"><img decoding=\"async\" width=\"349\" height=\"632\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-blocks-1.png\" alt=\"Toolset WooCommerce Blocks section\" class=\"wp-image-1770919\" srcset=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-blocks-1.png 349w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-blocks-1-166x300.png 166w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-blocks-1-83x150.png 83w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-blocks-1-287x520.png 287w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/woocommerce-blocks-1-300x543.png 300w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/a><div class=\"tb-image-caption\"><figcaption>Toolset WooCommerce Blocks section<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<p><\/p>\n","protected":false},"author":4341,"featured_media":1712611,"template":"","related-lesson":[8445],"class_list":["post-1688487","course-lesson","type-course-lesson","status-publish","has-post-thumbnail","hentry","related-lesson-e-commerce"],"_links":{"self":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/1688487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson"}],"about":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/types\/course-lesson"}],"author":[{"embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/users\/4341"}],"version-history":[{"count":8,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/1688487\/revisions"}],"predecessor-version":[{"id":1853141,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/course-lesson\/1688487\/revisions\/1853141"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/media\/1712611"}],"wp:attachment":[{"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/media?parent=1688487"}],"wp:term":[{"taxonomy":"related-lesson","embeddable":true,"href":"https:\/\/toolset.com\/de\/wp-json\/wp\/v2\/related-lesson?post=1688487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}