Smart Offers Shortcode Reference

Smart Offer has few custom shortcodes that you can use anywhere in posts, pages and even widgets. For more understanding on WordPress shortcodes you can check out the WordPress Codex.

1. Shortcode to Show Offer

In addition to default page option i.e Home, Cart, Before Checkout, Order Received, My Account, you can show offer on any other page with the use of Shortcode [so_show_offers]

Arguments passed to the shortcode:

'display_as' => 'inline' or 'popup',
'offer_ids' => '102, 148, 259'

The “display_as” argument determines how to display the offer. The value that can be passed to the argument can be “inline” or “popup”. If no value is passed then value would be taken from the option saved in “Which page/pages to show offer on -> Show offer as” of the offer that will be shown.

The “offer_ids” argument will show one of the offer from the ids mentioned in this argument. If no value is passed, then Smart Offers will fetch all offers having option “Any other page where shortcode is added” ticked under “Which page/pages to show offer on -> Show offer on” and show one of the offer satisfying Offer rules and Smart Offers Settings.

For eg,

[so_show_offers]
[so_show_offers display_as='inline' offer_ids='102']
[so_show_offers display_as='popup' offer_ids='148,259']

You can find offer’s shortcode as shown in the following screeshot (It is visible only after once you save/publish an offer) :

Shortcode Reference

Note: Make sure that the offers whose offer ids are entered in above shortcode, should not have any linked offers, as those functionality will not work. Because you’ve entered these offer ids to be displayed on this page. If there is any other offer that is set to be displayed after skipping the offer, it’ll not load that offer, instead it’ll load same offer again, as you’ve entered these offers to be displayed on this page.
Related blog: Shortcode to show Smart Offers on any page or post

2. Shortcode to Show Variation Option

Shortcode [so_product_variants] will show the variation option for the parent variable product. If you want to let your customer to select which variation product they would want as an offer, then add parent variable product in Offered product and shortcode [so_product_variants] in the offer description.

For eg,

[so_product_variants]

Related blog: Smart Offers, just the way you want it!

3. Shortcode to Show Product Image

Shortcode [so_product_image] will show the image of the offered product in the offer.

Arguments passed to the shortcode:

'image' => 'yes' or 'no'

For eg,

[so_product_image image='yes']

Note: If you add shortcode [so_product_image] and the offered product doesn’t have image, then it will show empty product picture in the offer.

4. Shortcode to Show Offered Product’s Price

Shortcode [so_price] will show the Original Price & the Offered Product’s price in the offer if the Offered Product is a Simple Product. This shortcode doesn’t need any arguments and it will generate a result like this:
Offer Price: Original Price – New Price For eg,

[so_price]
Shortcode Reference
Offer Demo

Note: Shortcode is to be only used if your Offered product is a Simple Product. If the Offered Product is Variable Product, then price shortcode is by default included i.e. you need not to write if your Offered product is a Variable Product.

5. Shortcode to Show Quantity

Shortcode [so_quantity] will allow you to offer more than one offered products to customer. If you add shortcode [so_quantity] with no parameter, the quantity box won’t appear in the offer.
To show quantity in the offer, add [so_quantity allow_change=true], this will show quantity box in the offer.

Arguments passed to the shortcode:

'value' => 2,
'min' => 1,
'max' => 1,
'allow_change' => true or false

The “value” argument defines what should be the quantity value. If “value” parameter is not passed then it is considered to be 1. If you want to offer your customer two fixed quantity of an offered product then add [so_quantity value=2]. This will not show quantity in the offer and quantity of offered product that will added to cart after accepting the offer will be 2.

The “min” argument defines what should be the minimum quantity that your customer can select. Default value for “min” parameter is 1.

The “max” argument defines what should be the maximum quantity that your customer can select.

The “allow_change” defines whether you want to allow your customer to change the quantity or not and indirectly determining whether to show quantity in the offer or not. Default value is false. If you want to allow your customer to change the quantity then pass value as true.

For eg,

[so_quantity value=3]
[so_quantity min=2 max=5 allow_change=true]

Note: You should either use value OR min, max, allow_change as shortcode params because specifiying value means you want to offer your customers fixed quantity of offered product whereas specifiying allow_change means you want customers to change quantityof offered product inside the offer.

6. Shortcode to Generate Accept link

Shortcode [so_acceptlink] will generate an accept url for the offer.

For eg,

[so_acceptlink]

7. Shortcode to Generate Skip link

Shortcode [so_skiplink] will generate an skip url for the offer.

For eg,

[so_skiplink]

 

« Back to Smart Offers