{"id":649,"date":"2021-11-21T22:44:49","date_gmt":"2021-11-21T22:44:49","guid":{"rendered":"https:\/\/demo.itthinx.com\/wvdc\/?post_type=document&#038;p=649"},"modified":"2021-11-21T22:52:36","modified_gmt":"2021-11-21T22:52:36","slug":"shortcodes","status":"publish","type":"document","link":"https:\/\/demo.itthinx.com\/wvdc\/document\/volume-discount-coupons\/shortcodes\/","title":{"rendered":"Shortcodes"},"content":{"rendered":"\n<p>The Volume Discount Coupons extension provides the following shortcodes:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&#91;volume_discount_coupons&#93; &#8211; Renders a pretty coupon with information.<\/li><li>&#91;coupon_volume_discount&#93; &#8211; Renders the generated volume discount information.<\/li><\/ul>\n\n\n\n<p>These shortcodes require the indication of the coupon code via the <code>code<\/code> attribute, for example:<\/p>\n\n\n\n<p class=\"has-text-align-center\"><code>&#91;volume_discount_coupon code=\"test\"&#93;<\/code><\/p>\n\n\n\n<p>&#8230; would render a <em>pretty coupon<\/em> for the couponwhose code is <code>test<\/code>.<\/p>\n\n\n\n<p>Here are examples of several pretty coupons that are rendered on the <a href=\"https:\/\/demo.itthinx.com\/wvdc\/coupons\/\" data-type=\"page\" data-id=\"590\">Coupons<\/a> page:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"801\" height=\"521\" src=\"https:\/\/demo.itthinx.com\/wvdc\/wp-content\/uploads\/2021\/11\/Examples-of-shortcode-generated-coupon-discount-information.png\" alt=\"\" class=\"wp-image-650\" srcset=\"https:\/\/demo.itthinx.com\/wvdc\/wp-content\/uploads\/2021\/11\/Examples-of-shortcode-generated-coupon-discount-information.png 801w, https:\/\/demo.itthinx.com\/wvdc\/wp-content\/uploads\/2021\/11\/Examples-of-shortcode-generated-coupon-discount-information-300x195.png 300w, https:\/\/demo.itthinx.com\/wvdc\/wp-content\/uploads\/2021\/11\/Examples-of-shortcode-generated-coupon-discount-information-768x500.png 768w, https:\/\/demo.itthinx.com\/wvdc\/wp-content\/uploads\/2021\/11\/Examples-of-shortcode-generated-coupon-discount-information-416x271.png 416w\" sizes=\"auto, (max-width: 801px) 100vw, 801px\" \/><\/figure><\/div>\n\n\n\n<p>The first coupon is rendered using <code>&#91;volume_discount_coupon code=\"sweaterspromo\"&#93;<\/code>. The reddish coupon is rendered using <code>&#91;volume_discount_coupon code=\"matchtops\" color=\"red\"&#93;<\/code> which includes a second color attribute that the shortcode understands.<\/p>\n\n\n\n<p>The shortcode requires one or more coupon codes passed through the&nbsp;<code>code<\/code>&nbsp;attribute:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>code<\/code>&nbsp;: (required) A coupon code or a comma-separated list of coupon codes \u2013 which coupon or coupons should be displayed.<\/li><\/ul>\n\n\n\n<p>All other attributes are optional:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>order_by<\/code>&nbsp;: Defaults to&nbsp;<code>none<\/code>&nbsp;(renders coupons in the same order as given through the code attribute), also accepts&nbsp;<code>code<\/code>and&nbsp;<code>id<\/code>.<\/li><li><code>order<\/code>&nbsp;: Defaults to&nbsp;<code>ASC<\/code>, also accepts&nbsp;<code>DESC<\/code>.<\/li><li><code>color<\/code>&nbsp;: Which color to use for the coupon or coupons:&nbsp;<code>red<\/code>,&nbsp;<code>green<\/code>,&nbsp;<code>blue<\/code>&nbsp;or&nbsp;<code>yellow<\/code>. More specifically, color CSS class applied along with&nbsp;<code>.coupon-countdown-container<\/code>&nbsp;and&nbsp;<code>.coupon-countdown<\/code>, defaults to&nbsp;<code>blue<\/code>.<\/li><li><code>stylesheet<\/code>&nbsp;: An alternative stylesheet can be loaded, must be a valid URL pointing to the stylesheet.<\/li><li><code>show_code<\/code>&nbsp;: Shows the coupon code.&nbsp;<code>yes<\/code>&nbsp;by default.<\/li><li><code>show_description<\/code>&nbsp;: Show the coupon\u2019s description.&nbsp;<code>yes<\/code>&nbsp;by default.<\/li><li><code>show_discount<\/code>&nbsp;: By default, coupons show the automatic discount info. Use&nbsp;<code>show_discount=\"no\"<\/code>&nbsp;to disable that.<\/li><\/ul>\n\n\n\n<p>Note that the stylesheet is only loaded once and only if the shortcode is used.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":572,"menu_order":300,"comment_status":"closed","ping_status":"closed","template":"","document_category":[],"document_tag":[],"class_list":["post-649","document","type-document","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/document\/649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/document"}],"about":[{"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/types\/document"}],"author":[{"embeddable":true,"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/comments?post=649"}],"version-history":[{"count":3,"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/document\/649\/revisions"}],"predecessor-version":[{"id":656,"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/document\/649\/revisions\/656"}],"up":[{"embeddable":true,"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/document\/572"}],"wp:attachment":[{"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/media?parent=649"}],"wp:term":[{"taxonomy":"document_category","embeddable":true,"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/document_category?post=649"},{"taxonomy":"document_tag","embeddable":true,"href":"https:\/\/demo.itthinx.com\/wvdc\/wp-json\/wp\/v2\/document_tag?post=649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}