Display Text or Images on the Order Confirmation Page Only in Site Builder

Display the Text or Images on the Order Confirmation Page only.

Follow the steps below to render a text or an image on the Order Confirmation page.

Solution
  1. Create a Custom Tag
    Note: Tag substitution is required to accomplish this. 
    1. Navigate to Commerce > Site Builder > Tags > New
      • Tag: Enter Tag
        Example: CHECKTAG
      • Description: Enter Description
      • Default Value: Enter Default Value
    2. Click Save
  2. Add a <div> Tag in the Theme
    Note: This is the location of the text that is displayed on the Order Confirmation Page. It is the user’s preference on where to place it in the Content Area.
    1. Navigate to Commerce > Site Builder > Themes
    2. Click Edit on Custom Theme applied on the webstore
    3. Click Body tab
      • Content Area Template: Enter a <div> tag that contains an ID for the Tag Substitution
        Example:<TD><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"></TABLE><div id = "ordertagid"></div></TD>
      • Footer Template: Enter the Custom Tag created at step 1 enclosed in opening and closing chevrons.
        Example: <CHECKTAG>
    4. Click Save
  3. Enter the value for the custom tag.
    1. Navigate to Commerce > Site Builder > Tabs
    2. Click Edit onCheckout
    3. Click Tag Substitution tab
      • Tag: Select ​Tag
        Example: CHECKTAG​​​​​​
      • Substitution Value: Enter the Custom Code that will show the Text or Image
        Example:
      • <script type="text/javascript">
        function gup( name )
        {‌
            name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
            var regexS = "[\\?&]"+name+"=([^&#]*)";
            var regex = new RegExp( regexS );
            var results = regex.exec( window.location.href );
            if( results == null )
            return "";
          else
            return results[1];
        }
           var order_cat = gup( 'category' );
             if (order_cat=="thanks"){‌
             document.getElementById('ordertagid').innerHTML= "TEST";
        }
        </script>

Leave a comment

Your email address will not be published. Required fields are marked *