No announcement yet.

Savings as percentage

  • Filter
  • Time
  • Show
Clear All
new posts

  • Gaelen
    I had wondered about that, I thought there might have been an option I just missed rather than doing the math like that.

    Thanks for the piece of code saves me a few minutes of writing at least

    Leave a comment:

  • molder101
    Not sure if you figured this out, but you have to do the math in your code.

    Add some javascript where you want it to display:

    var MSRP = "[price2]"; 
    var Save = "[savings]"; 
    var Perc = 0;
    MSRP = MSRP.replace(/\$/g,''); 
    Save = Save.replace(/\$/g,''); 
    Perc = Save/MSRP * 100; 
    document.write("(" + Math.round(Perc) + "%)");
    For convenience, you could build a function and simple send the info to it like:

    function Percentage ([price2], [savings])
    Last edited by molder101; 08-19-2011, 12:20 PM.

    Leave a comment:

  • Gaelen
    started a topic Savings as percentage

    Savings as percentage

    I'm trying to setup up my homepage specials to display percentage off instead fo dollar amount? I was hoping with this tag it would work but it's still grabbing a dollar amount.

    <!--START: savings_percentage-->
    <div id="discount"><span id="discount-amt">[savings_percentage]%<br/>OFF</span></div>
    <!--END: savings_percentage-->

    has anyone gotten something like this to work yet?