WooCommerce ShortCodes and its Usage : Complete Guide

WooCommerce ShortCodes and its Usage : Complete Guide

In this era of e-commerce stores, WooCommerce Shortcodes helps everyone who wants their website to look perfect. And one should take each and every possible step to do so. 

Users working on WordPress and woocommerce for their e-commerce store to make it globally popular and give them a burst in sales are using Woocommerce Shortcodes.

In addition to lots of features of WordPress and Woocommerce together, there is one thing that can help you to design your online store even better, and that is Woocommerce Shortcodes.

Do you want to add some interesting content in your woocommerce website pages? Yes, you can definitely do it with the Shortcodes.

What is Woocommerce Shortcodes?

Woocommerce shortcodes are small pieces of texts/codes written within square brackets. These codes are then placed in your Woocommerce pages and templates to show certain values from the database.

Shortcodes provides us an easy way to add special content almost anywhere on the website as it does not require so much of technical coder knowledge. Due to this, shortcodes are very popular and interesting to work on.

Sounds great? If yes, then keep reading this article.

To use woocommerce shortcodes, you would need WooCommerce Shortcodes Plugins.

Firstly, you need to install and activate a plugin for woocommerce shortcodes. There are many but we would suggest going with mostly used Woocommerce Shortcodes, specially made for Woocommerce shortcodes.

Requirements of the plugin

Install this plugin via following the steps below :

  • Go to the admin dashboard.
  • Click on Plugin > Add new on the left sidebar.
  • Search for the plugin ‘woocommerce shortcodes’.

woocommerce shortocdes plugin

  • Install and activate the plugin.
  • After activation, you can see a shortcode button in your page editor and post editor.
  • Click on the button and dropdown list of all the products will occur.

shortcodes plugin, woocommerce,

Now as you have successfully activated the plugin.

Now, let’s begin with some of the WooCOmmerce Shortcodes and their usage.

Best WooCommerce ShortCodes

1. CART 

[woocommerce_cart]

It is used on the cart page and displays the customer’s cart content. This shortcode helps in structuring coupons codes and related cart features and pieces.

Tip: Use the full-width page template with this shortcode.

2. CHECKOUT

[woocommerce_checkout]

This particular shortcode is used for displaying the checkout process on the checkout page of your online store.

woocommerce shortcode , wordpress support

Tip: Use the full-width page template with this shortcode.

3. Order Tracking Form

[woocommerce_order_tracking]

This shortcut is used to display Order Tracking page and allows a user to check the status of an order by entering the required details like order id, email or phone number.

woocommerce shortcodes, wordpress

Tip: Use the full-width page or Shop Sidebar template with this shortcode.

4. My Account

[woocommerce_my_account]

This shortcode displays ‘my account’ section featuring options for the customer to view its past orders or update any of its personal information. The number of orders can be specified manually.

Tip: By default, it’s set to 15 (use -1 to display all orders.)

Special Woocommerce Pages

Listed below shortcodes can be used to create custom shop pages such as featured products, top-rated products, best selling products etc.

Best Selling Products

[best_selling_products per_page=”12”]

It displays the list of best selling products of the store. You can also customize product limit and columns.

best selling products, woocommerce shortcodes

Tip: Use the full-width page or Shop Sidebar template with this shortcode.

Top-Rated Products

[top_rated_products per_page=”12”]

Using this shortcode, you can enable the list of top rated products for the customers to go through other quality stuff.

woocommerce shortcode, top rated products, wordpress

Tip: Use the full-width page or Shop Sidebar template with this shortcode.

Recent Products

[recent_product per_page=”15” columns=”3”]

Although shop page template does this by default, if you want a specially formatted different landing page which sets apart from main shop index, you can definitely use this shortcode.

woocommerce shortcode, recent products, wordpress

Tip: Use full-width page or Shop Sidebar template with this shortcode.

Note: The ‘per_page’ attribute means how many products you want to show on the page and same goes for the columns attribute deciding in how many columns should the products be listed. And this may vary from person to person according to their personal choices.

Add to Cart

To show the price and add to cart button of a single product by ID, we use this following shortcode :

         

array(

                    ‘Id’ => ‘99’

                    ‘style’ => ‘border:4px solid #ccc; padding: 12px;’,

                    ‘sku’ => ‘FOO’

                    ‘style’ => ‘TRUE’

                    ‘class’ => ‘CSS-CLASS’

            )

          [add_to_cart id=”99”]

add to cart shortcode, woocommerce shortcode

Add to Cart URL

[add_to_cart_url id=”70”]

It enables to show the URL on the add to cart button of a single product. You can also specify the product by ID.

Troubleshooting Shortcodes

In case the display looks incorrect instead of correctly posting your shortcodes, make sure that you did not embed the shortcode between <pre> tags.

This is a common issue, to remove these tags, edit the page, and click the Text tab as shown in the image above.

Product Category

To add Product categories loop and output we use this shortcode.

[product_category category=”one”]  : used for categories section.

Listed are seven more attributes to this shortcode which you can apply.

  • ‘number’ => ’null’,  – shortcode used to show the number of categories.
  • ‘orderby’ => ‘name’,  – use this shortcode to display the order, whereas name and date are both valid options.
  • ‘order’ => ‘ASC’, – use this shortcode to represent how product categories are ordered, “ASC” or “DESC”.
  • ‘columns’ => ‘4’, – use this shortcode to represent the number of columns in which categories are organized.
  • ‘hide_empty’ => ‘1’, – use this shortcode to represent SET to 1 to HIDE categories with no products to show.
  • ‘parent’ => ‘’, – use this shortcode to represent SET to 0 for showing only top level categories.
  • ‘ids’ => ‘’, – use this shortcode to represent that IDs can be set to only output specified results.

Live Product Filter Shortcodes

There is the option of ‘filter’. It can be customized using the following Woocommerce Shortcodes.

[woocommerce_product_filter] – allow you to show a live Product Search Filter.

[woocommerce_product_filter] – this will show you a live Product Attribute Filter.

[woocommerce_product_filter_category] – this enables you to show a live Product Category Filter.

[woocommerce_product_filter_price] – this enables you to show a live Product Price Filter.

[woocommerce_product_filter_tag] – it displays you a live Product Tag Filter.

Coupon Shortcodes

There are many plugins available for coupon shortcodes which can influence the customers for better sales results.

These are very customizable as they provide a set of conditional shortcodes, in which you can set options as you want. It also helps in displaying the based on coupons’ availability.

You can also choose whether the customer wants to select a coupon or not, it simplifies this by allowing display specific content. And the same way you can also display the content based on the validity of the coupon.

coupon code shortcode, woocommerce shortcodes

Some available shortcodes are – [coupon_is_applied], [coupon_is_not_applied], [coupon_is_valid], [coupon_is_not_applied].

To add some other information to coupon codes use these shortcodes like [coupon_code], [coupon_description] and [coupon_discount].

Conclusion

So that was all about shortcodes, a great way to enhance your online store with these easily structured ShortCodes. In starting you may feel a bit of complication in using but later on it will become interesting and will be helpful for your shop.

With this goodbye for now! Hope this article has helped you in understanding Shortcodes in Woocommerce and its usage.

If you are still facing problem then you also have another option of getting help from our WooCommerce Support Team. Without any wastage of your precious time, you will get the best support by our WordPress Experts. Dial + 1 844 897 0441(Toll-Free).

Read More blogs:



Leave a Reply