Your WooCommerce homepage might include different lists of products. One of them can be a list of a few recent products that belong to a specific taxonomy term. Toolset allows you to create such a list in a completely visual way.
You will learn how to use the View block to display three recent products for women. «Women» is one of the terms of a custom taxonomy named «Department». To learn how to categorize products in such way visit the lesson about adding a custom taxonomy to WooCommerce Products.
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.
Steps for creating a list of products for a taxonomy
Create a View for displaying products
- Edit or create a page and insert the View block.
- In the View-creation wizard, stick to the default Grid in the Select View Loop Style section.
- In the last step of the wizard, select Products as your post type.
- In the View Loop, insert a Container block and set its background to Image.
- Make the image dynamic and link to the post’s featured image.
- Inside your Container block, insert one more Container block with a solid background set to black.
- Insert the Toolset Heading block inside your inner Container and set it to the dynamic title as a link.
We will improve the styling later.
Add taxonomy filters to your View
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.
- Use the Block Navigation button to select the main View block.
- In the right-hand sidebar, expand the Content Selection section.
- Add a filter and select your taxonomy in the Taxonomy section.
- Check one of your taxonomy terms, i.e. «Women».
Limit the number of products to show
By default, your View will display all products meeting your filter criteria. Let’s see how to limit the number of products to the recent three.
- Use the Block Navigation button to select the main View block.
- In the right-hand sidebar expand the Limit and offset section. Set the number of items to display to 3.
Adjust the styling
- Select the outer Container block of your View Loop.
- In the Additional Settings section, set the left and right paddings to zero.
- In the Inner Content section, set up the Min-Height setting to 30px and choose the Vertically Align Bottom option.
- Select the inner Container block of your View Loop.
- Expand the Background section, click on the Custom Color, and in the pop-up that appears use the bottom slider to reduce the opacity.
Add WooCommerce fields to your View
Use blocks from the Toolset WooCommerce section to insert WooCommerce fields into your Views such as the Product Price, Product Rating, and Add to Cart Button.
Cree listas de entradas personalizadas
Related topics
- Assigning Templates to Posts Conditionally
- How to Display WooCommerce Orders on the Front-end
- Using the WooCommerce Subscriptions plugin with Toolset
- Using WooCommerce Fields in Product Forms
- Selecting WooCommerce Blocks Output Type
- Adding Toolset Blocks to the WooCommerce My Account Page
- Creating a Page with a Custom WooCommerce Product Search
- Building a Custom WooCommerce Shop Page
- Creating Custom Templates for WooCommerce Products
- Creating a Custom List of Related WooCommerce Products
- Adding a Custom Taxonomy to WooCommerce Products
- Creating a Custom WooCommerce Product Slider
- Adding Custom Fields to WooCommerce products
- Creating Front-end Forms for Adding WooCommerce Products
- Charge users for registering premium accounts
- Charge users for submitting content
- Custom WooCommerce Roles and Admin Capabilities