Let’s look at the most commonly used and useful WooCommerce Shortcodes.[recent_products] – displays the last added products [featured_products] – to display featured products
The shortcode [featured_products] displays the products in exactly the same form as the previous [recent_products], and also has the same parameters. The only point is that the product should be marked as “recommended” in admin area. Using this shortcode, you can display any number of recommended products, as well as filter them by category.[product] – when you need to display a specific product
You need to specify an additional parameter, for example, ID (you can see the product’s ID in the admin area in the list of all products) [products] – display of certain products by their ID or article number
You can specify separated by identifiers or product numbers
This shortcode supports columns, orderby, and order parameters, as in the [recent_products] shortcode.[product_category] – displays products from a specific category (or categories)
This is very similar to [recent_products], the only difference is that the order parameter accepts the default value of ASC, and the orderby parameter accepts the default menu_order title (sort first in order, and with the same order values – by title), and category – required parameter.[product_categories] – lists links to product categories [product_page] – essentially displays the entire product page
Displays a full product card with an image, button “add to cart”, etc[sale_products] – displays all products that are currently “on sale”
The shortcode has exactly the same parameters as [recent_products], by default, products are sorted alphabetically, and the display-template is also slightly different.[best_selling_products] – products sorted by sales
The shortcode has the parameters per_page, columns, category and operator. Using the last two, you can display the best-selling products in any specific categories.
Sorting occurs on an arbitrary field total_sales.[top_rated_products] – highest rated products
Here is a set of parameters, like the [recent_products] shortcode, but sorting is done by user rating.[related_products] – displays related products for the current product in the loop – this means that we cannot use this shortcode on some random page – in this case, it simply will not output anything.
By default, 4 random items are displayed in 4 columns ([related_products per_page = “4” columns = “4” orderby = “rand”] If nothing is specified, then the shortcode will not output anything.[product_attribute] – allows you to display all products with a specific value of an attribute
Available parameters: per_page, columns, category and operator
We also have two more parameters: attribute – the label of the attribute, and filter – the value of this attribute, and you can specify several values separated by commas.(display products with a color attribute equal to “red” or “blue”).
More information and official documentation is available on the developer’s site