Categories
WordPress

WooCommerce shortcodes you definitely need to know

With over 15 million downloads on WordPress.org, WooCommerce is the popular e-commerce plugin among WordPress community. If you’re developing theme for WooCommerce, there are few shortcodes that might help you in theme development.

Here are our list of  WooCommerce shortcodes, you might not be aware of but definitely need to know for better theme customization.

  1. Recent Products
    This shortcode is helpful if you want to display recent product in homepage.
    Example:

    [recent_products]

    You can pass arguments in shortcode to change number of product you want to display, order of product and columns.
    Example:

    [recent_products per_page="8" columns="4"]
  2. Best Selling Products
    This shortcode is used to display best selling product in store.
    Example:

    [best_selling_products per_page="8" columns="4"]
  3. Featured Products
    This shortcode is used to display those products which has been set as a “featured”.
    Example:

    [featured_products per_page="8" columns="4" orderby="date"]
  4. Top Rated Products
    This shortcode is used to display top rated products on sale in store.
    Example:

    [top_rated_products per_page="8" columns="4" orderby="title"]
  5. Attribute Based Products
    This shortcode is used to display products based on attribute. You can filter product based on attribute value.
    Following example displays product based on attribute “size” and filtered with value “large”.
    Example:

    [product_attribute attribute="size" filter="large" orderby="date" order="desc"]
  6. Products on sale
    This shortcode is used to display products that are on sale.
    Example:

    [sale_products per_page="8" orderby="date"]
  7. Category Based Products
    This shortcode is used to display multiple products based on category slug. You can check categories slug by navigating to Products > Categories in WordPress admin menu.
    Following example displays product based on category “T-shirt” whose slug is “tshirt”.
    Example:

    [product_category category="tshirt" orderby="date" order="desc"]

Furthermore, you can find other list of shortcode on WooCommerce docs: https://docs.woothemes.com/document/woocommerce-shortcodes/

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.