WooCommerce Shortcodes Overview

You can prepare custom product pages on your e-commerce site with WooCommerce shortcodes. If you do not have a professional experience with WooCommerce before, this content will be very helpful to you. The WooCommerce e-commerce system comes with a few shortcodes that can be used to add products to your blog posts and pages. You […]

WooCommerce Shortcodes Overview

You can prepare custom product pages on your e-commerce site with WooCommerce shortcodes. If you do not have a professional experience with WooCommerce before, this content will be very helpful to you.

The WooCommerce e-commerce system comes with a few shortcodes that can be used to add products to your blog posts and pages. You can use the products you want and the categories of the products on special pages with these codes. You can list your discounted products on a page, or display your e-commerce products on your site in the blog contents you have prepared.

How to Use WooCommerce Shortcodes

Before asking this question, let’s answer the question of where are shortcodes used. It is possible to use WooCommerce shortcodes in all page and blog content, special structural areas and component areas on your site. An example WooCommerce shortcode is used in the image below;

It is possible to add any WooCommerce shortcodes you want with the “shortcode” block you will create in the new post editor. If you are using the classic text editor, you can paste the code directly.

WooCommerce Default Page Shortcodes

In order for your e-commerce site to work smoothly, you must create the pages of the shortcodes below. If you have prepared your site with the WooCommerce starter wizard, these pages are already ready and you don’t need to do anything.

[woocommerce_cart] - shop page
[woocommerce_checkout] - checkout page
[woocommerce_my_account] - customer account page
[woocommerce_order_tracking] - order tracking page

Product Shortcodes

In the examples below, I will share with you shortcodes specific to some product structures. With these codes, it is possible to show your products as a special list on any page.

Mixed Product Listing

The structure we created in this scenario is as follows;

  • Number of products to display: 4
  • Number of products to display per column: 4
  • Product listing type: Popular products
  • Show on sale: On (hides what’s on sale if you set it to false instead of true)
[products limit="4" columns="4" orderby="popularity" class="quick-sale" on_sale="true" ]

Listing Featured Products

The structure we created in this scenario is as follows;

  • Number of products to display: 4
  • Number of products to display per column: 2
  • Products to display: Featured products
[products limit="4" columns="2" visibility="featured"]

Listing from Different Categories

The structure we created in this scenario is as follows;

  • Number of products to display: 8
  • Number of products to display per column: 4
  • Category: 2 different categories
  • Structure: first category AND second category
[products limit="8" columns="4" category="hoodies, tshirts" cat_operator="AND"]

In addition to the examples above, you can visit this page for all WooCommerce shortcodes. WooCommerce normally lists products by category and tag structure. Shortcodes shared in this content are generally for e-commerce sites that need special modification.

If you want to contribute, please join me in the comments area. To follow this and similar content, visit my WooCommerce page.

Leave a Reply

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