Using a Promocode for Shipping Method

Below is an example of how you can add promo codes easily within your web forms that you download from Lime Light CRM for each campaign. This code can be applied to any type of campaign that you build within Lime Light CRM.



To integrate this into your web form code, you will need to first create a separate shipping method that you would like to offer your customers to be used as an incentive strategy. This shipping method will be the price that your customers receive when they enter the correct promo code that you provide them. 



Once you have created the discounted shipping method you can easily add the code below into your web forms. If you are creating a one page web form then you will add this piece of code on page one; if you are creating a two page campaign then you will add it to your page two. Use the rule that you will always be adding this piece of code on your billing page wherever it applies. 

You can paste it anywhere you prefer on the page, we recommend you paste it wherever you want the promo code text box and button to appear on your page. 

Once pasted, you will need to adjust some fields to tailor it to your campaign. 



1) Adjust the "PROMOCODE" and "promocode" fields to be whatever you want your consumer to insert for the promo code to receive the discounted shipping. Example: DIET2010. Enter the code in upper case as well as lower case letters to accept it either way the customers submit it.

2) Adjust the "Standard Mail (4-6)" text to your shipping method name which is within Lime Light CRM that you have created. Note this will be your discounted shipping method name.



3) Adjust the shipping method Id and initial price for your discounted shipping method, this would be found within your Lime Light CRM system under Clients&Fulfillment > Shipping. Once you've located the values for these fields please adjust them within the code.

Example:
elOptNew.value = '1';
elOptNew.title = '1.95';

Once these have been adjusted, you should be able to execute this page and type in your promo code in upper case letters or lower case letters, and it will adjust the price for you once applied.




Here is the code:


<span id ="span_promo">
<input size="6" name="promo" id="promo"/>&nbsp;
<input value="Apply" onclick="CheckCode()" type="button"/></span>

        <script>
        function CheckCode(){ var promotxt=document.

getElementById("promo");
        // Insert your Promo Code below, recommended to create a upper case and lower case version for each promo code
        if(promotxt.value=="PROMOCODE" ||promotxt.value=="promocode"){
                var elSel = document.getElementById('shipping');
                var i;
                     for (i = elSel.length - 1; i>=0; i--) elSel.remove(i);
                     var elOptNew = document.createElement('option');
                // Insert your Shipping Method name below
                     elOptNew.text = 'Standard Mail (4-6 Days)';
                // Insert your Shipping Method ID & Price below
                elOptNew.value = '1';
                elOptNew.title = '1.95';
        try {
        elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
                 }
        catch(ex) {
        elSel.add(elOptNew); // IE only
                        }
        SetShippingValue();
        document.getElementById("span_promo").style.visibility="hidden";                   
        }else{
        alert("Please enter a valid promo code.");
        promotxt.select();
        window.setTimeout(function(){promotxt.focus()},20);
                        }
                }
        </script>

Have more questions? Submit a request

0 Comments

Article is closed for comments.