Announcement

Collapse
No announcement yet.

Can I display a message that counts down to free shipping?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can I display a message that counts down to free shipping?

    If you have set up your store to offer free shipping for orders that are over a certain value, you can use the following script in your layouts to include a message that tells people how much more they have to spend to qualify for free shipping.

    <script language="javascript" type="text/javascript">
    function de(prc) {
    var data, endata;
    data = new String(prc);
    data = data.split(" ");
    endata = cut(data[0]);
    return endata;
    }
    function cut(dpt) {
    stng = dpt.replace("£","");
    stang = stng.replace(".",".");
    stang = stang.replace(",","");
    return stang; }
    var left;
    price = de(getCartItem(1));
    if (price >= 100) {
    document.write("You have qualified for free shipping!");
    }
    else {
    left = (10 - price).toFixed(2);
    document.write("You need to spend £"+left+" to obtain free shipping!");
    }
    </script>
    The '100' represents £100.00 (or $100.00 – depending on what currency you are using). You can change this to suit your requirements.

    Disclaimer: This code was provided by an SellerDeck user via the SellerDeck Community (http://community.sellerdeck.com/) and so can't be supported by the SellerDeck Technical Support team.
Working...
X