Skip to content

Instantly share code, notes, and snippets.

@jagmitg
Created July 22, 2013 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jagmitg/6056700 to your computer and use it in GitHub Desktop.
Save jagmitg/6056700 to your computer and use it in GitHub Desktop.
#LOCAL("CurrencyID", #INPUT.Currency)
#LOCAL("LocalListPrice", #FUNCTION("LISTPRICE", #Object, #CurrencyID, #Shop.TaxModel))
#IF(#DEFINED(#LocalListPrice))
<p class="listing-price">#LocalListPrice[money] #IF(#PriceQuantity != 1)/ #PriceQuantity #OrderUnit.NameOrAlias#ENDIF#IF(#OrderUnit.Alias NE "piece" AND #PriceQuantity == 1)/ #OrderUnit.NameOrAlias#ENDIF &nbsp;&nbsp;#IF(#OriginalPrice > #ListPrice)<script type="text/javascript">var discountFinal=function(firstly,secondly){var totalfirst=secondly-firstly;var totalsecond=totalfirst/secondly;var totalthird=totalsecond*100;if(document.getElementById("discountCode").innerHTML===null){document.getElementById("spanishtwo").innerHTML.replace("%","")}else{document.getElementById("spanish").innerHTML=Math.floor(totalthird/5)*5}};discountFinal(#OriginalPrice,#ListPrice);</script><div id="discountCode" style="display:none;"><span id="spanish"></span><span id="spanishtwo">%</span></div><span class="space-out">RRP: #OriginalPrice[money]#ENDIF</span></p>
#ENDIF
#ENDLOCAL
#ENDLOCAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment