Show sales with a shortcode

This feature is a part of Product Discounts. Click here to see all Product Discounts features.

You can use a shortcode to promote a product with a discount applied. To place a promo box, use the [promo_box]. You can place it anywhere on the website, and it will show a random product with the discount applied. That means the shortcode will show nothing if there are no available products with a discount.

With a [promo_box] shortcode, you can build a section on the website where the sales promotion will appear.

You can use “include” and “exclude” shortcode attributes to advertise different products in certain sections on a page.

Shortcode attribute: include

The ‘include’ attribute will show only products with selected ids.

A shortcode [promo_box exclude=2] will never show a product with an id ‘2’ (even if it has a discount applied).

Shortcode attribute: exclude

The exclude attribute will show the discount products that don’t have the selected id.

The “include” attribute works in the opposite. E.g. a shortcode [promo_box include=”2″] will show only a product with id “2” but only if it has the discount applied.

Shortcode attribute: image

You can show the product image inside the shortcode output. Use the following: [promo_box image=”1″].

After you place a desired shortcode on a page, post, product or any other content page, it will show up as in the example below:

Product Discount Promo Box

The promo box shortcode has a predefined layout, but you can easily change it with CSS.