Shortcodes included with WooCommerce
– shows the cart page
– shows the checkout page
– shows the order tracking form
– shows the user account page
Used on the cart page, the cart shortcode displays cart content and interface for coupon codes and other cart bits and pieces.
Used on the checkout page, the checkout shortcode displays the checkout process.
Order Tracking Form
Lets a user see the status of an order by entering their order details.
Shows the ‘my account’ section where the customer can view past orders and update their information. You can specify the number of orders to show. By default, it’s set to 15 (use -1 to display all orders.)
Lists recent products – useful on the homepage. The ‘per_page’ shortcode determines how many products to show on the page and the columns attribute controls how many columns wide the products should be before wrapping.
[recent_products per_page="12" columns="4"]
Works the same as recent products but displays products that have been set as “featured.” In this example, the shortcode is saying: Show 12 featured products in 4 columns.
[featured_products per_page="12" columns="4"]
Show a single product by ID or SKU.
[product id="99"] [product sku="FOO"]
Show multiple products by ID or SKU. Make note of the plural ‘products.’
[products ids="1, 2, 3, 4, 5"] [products skus="foo, bar, baz" orderby="date" order="desc"]
Add to Cart
Show the price and add to cart button of a single product by ID.
Add to Cart URL
Echo the URL on the add to cart button of a single product by ID.
Show multiple products in a category by slug.
Go to: WooCommerce > Products > Categories to find the slug column.
Display product categories loop
[product_categories number="12" parent="0"]
Set the parent parameter to 0 to only display top level categories. Set IDs to a comma separated list of category IDs to only show those.
Show a full single product page by ID or SKU.
[product_page id="99"] [product_page sku="FOO"]
List all products on sale.
List best-selling products on sale.
List related products.
Top Rated Products
List top-rated products on sale.
List products with an attribute shortcode.
[product_attribute attribute='color' filter='black']