PDA

View Full Version : Also display prices in.. Norman?


Kai
19-Aug-2003, 04:33 AM
I trying to turn off the 2nd currency in * under
Design-->Option-->Misce-->Also display prices in..
but once I turn it off. My Price per metre and Today Rate will be gone. Why is this so? And how should I do?
------------------------------------------------------------------------------
Price per cm: S$0.55 / US$0.32*
Price per metre: S$55 / US$32*

Today Rate: US$32 Euro$29 per meter
------------------------------------------------------------------------------
I added the extended info in product template as :

<b>NETQUOTEVAR:PRODUCTPRICE</b>
<script language=JavaScript>
<!--
var mainprice = metreprice(thiscost);
if ( mainprice) document.write('<br><b>' + mainprice + '</b>');
//-->

Thank in advance.

NormanRouxel
19-Aug-2003, 08:42 AM
Try using this replacement routine:-

function metreprice(thiscost) { // convert an single price actinic price string into 100 times it's size
var newprice = '';
thiscost = thiscost.replace(/./g,".");
var nums = thiscost.match(/(.*)(\d+)\.(\d)(\d)(.*)/);
if (nums != null)
{
newprice = 'Price per Metre: ' + nums[1] + ((nums[2] * 100) + (nums[3] * 10 ) + (nums[4] - 0)) + '.' + '00';
}
return newprice;
}


I havn't tested it as I've no more time left to help you and have deleted your test site.

Norman

Kai
19-Aug-2003, 10:28 AM
It is ok Norman. Thank to you, I am on the edge of completing my project. Thank again.