Home > Docs > Smart Coupons for WooCommerce > Display WooCommerce Coupons Using Shortcodes

Display WooCommerce Coupons Using Shortcodes

Last updated on August 14, 2023

Smart Coupons for WooCommerce plugin can generate coupon codes seamlessly in different ways. By default, the plugin creates shortcodes for all the coupons in the store. You can make use of these shortcodes to display coupons for promotions or various other purposes.

Regardless of the user role (including guest users), any visitor can view the available coupons. To display all available coupons in your store in blogs, posts, or even in sections of the store, primarily use shortcodes. To display coupons using Shortcodes:

  1. Navigate to All coupons page.
  2. Copy the required shortcodes.
  3. Paste the shortcodes in posts, blogs, or in the edit window of any page in the store.

Getting started

To access the shortcodes:

  • From the WordPress admin dashboard, navigate to Smart Coupons > All Coupons.
  • Under the Shortcode section of the table, you can find a list of shortcodes for all coupons, as shown below. You can copy and paste these shortcodes to any page where you want to display these coupons.
Smart Coupons for WooCommerce - Shortcodes for coupons
Smart Coupons for WooCommerce – Shortcodes for coupons

Display coupons in blogs or posts

To display coupons in a pre-defined format on any blog post, follow the given steps:

  • First, select an existing coupon or create a new one to copy its shortcode.
  • To illustrate, consider the coupon with the coupon code flat30.
Smart Coupons for WooCommerce - Shortcode example
Smart Coupons for WooCommerce – Shortcode example
  • The shortcode corresponding to the coupon flat30 is [wt-smart-coupon id=116].
  • Once you have copied the shortcode, you can easily paste it into any blog post to display the coupons.

For example, consider the blog shown below:

Smart Coupons for WooCommerce - Shortcodes demo using blog post
Smart Coupons for WooCommerce – Shortcodes demo using blog post

Publish or preview the post to get the front-end view as shown below:

Smart Coupons for WooCommerce - Shortcodes demo using a blog post
Smart Coupons for WooCommerce – Shortcodes demo using a blog post

Likewise, you can use shortcodes to display coupons on posts or pages for promotions or for any other purposes.

Note:

Customize the coupons using the Customize coupon section in the General settings.

Smart Coupons for WooCommerce - Customize coupon page
Smart Coupons for WooCommerce – Customize coupon page

To know more about Coupon customization, click here.

Display All Available Coupons Using Shortcodes

Throughout the purchase process, customers can benefit from multiple available coupons. Use the provided shortcode to centralize all available coupons in one location. The coupons can be displayed in a variety of locations, giving you the freedom to pick and choose according to your preferences.

Displaying all available coupons on a custom page

  • A custom page named ‘Coupons List’ is added to the main menu to display all available coupons.
Smart Coupons for WooCommerce - Shortcodes demo using a custom page
Smart Coupons for WooCommerce – Shortcodes demo using a custom page
  • Now use the shortcode [wt_sc_user_available_coupons] on the custom page editor window to display all available coupons.
Smart Coupons for WooCommerce - Shortcodes demo using a custom page
Smart Coupons for WooCommerce - Shortcodes demo using a custom page
Smart Coupons for WooCommerce – Shortcodes demo using a custom page
  • Then the front-end view will look as shown below.
Smart Coupons for WooCommerce - Shortcodes demo using a custom page
Smart Coupons for WooCommerce – Shortcodes demo using a custom page

Furthermore, the shortcode can be added to the ‘cart page’, ‘product page’, or any custom page to display all available coupons.

Additionally, you can link shortcodes with a coupon URL that applies automatically when redirected.