1. Home
  2. Knowledge Base
  3. WooCommerce Shortcodes

WooCommerce Shortcodes

ShortcodeDescription
[woocommerce_cart]Shows content of the shopping cart page
[woocommerce_checkout]Shows content of the checkout page
[woocommerce_order_tracking]Shows the order tracking form
[woocommerce_my_account order_count="12"]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 (use -1 to display all orders).
[recent_products per_page="12" columns="4"]Lists recent products. You can specify how many products to show on each page and how many columns wide the products should be before wrapping.
[featured_products per_page="12" columns="4"]Works the same as recent products but displays products that have been set as “featured”
[product id="99"]
[product sku="c01"]
Shows a single product by ID or SKU
[products ids="1, 2, 3, 4, 5"]
[products skus="c01, c02, c03" orderby="date" order="desc"]
Shows multiple products by ID or SKU. Make note of the plural ‘products.’
[add_to_cart id="99"]Shows the price and Add to Cart button of the specified product
[add_to_cart_url id="99"]Displays the URL of the “Add to Cart” button of the specified product in text form
[product_category category="appliances"]Shows multiple products in the specified category
[product_categories number="12" parent="0"]Displays product categories loop
[product_page id="99"]
[product_page sku="c01"]
Shows content of a single product page by ID or SKU
[best_selling_products per_page="12"]Lists best-selling products
[related_products per_page="12"]Lists related products
[top_rated_products per_page="12"]Lists top-rated products
[product_attribute attribute="color" filter="black"]Lists products with the specified attribute

Sorting Products

In the following shortcodes, you can use the “orderby” attribute to order products by menu_ordertitle, date, rand, id:

  • [recent_products]
  • [featured_products]
  • [products]
  • [product_category]
  • [sale_products]
  • [top_rated_products]
  • [product_attribute]
  • [related_products]

For example:

[products skus="c01, c02, c03" orderby="date" order="desc"]
Was this article helpful?
0 replies

Comments/Questions

Please note that this is not a support forum. If you are experiencing issues on your site, please open a support ticket instead. Site-specific support questions submitted as comments will be unanswered.

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest