Only show Alternate currency when it's selected.

Automatic multi currency display on entire catalog.

Run your catalog in a main currency (or a main and alternate) with the customer having the option to turn on an additional currency throughout the Catalog, Cart and Checkout.
Post Reply
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Only show Alternate currency when it's selected.

Post by norman »

N.B. I think this is a bad idea as the Cart operates in your usual currency and that's what's passed to the PSP. Thus the following will not be supported.

If you still want to only show the alternate currency when one has been selected. I.e. hide the usual Catalog prices then read on.

The code that displays on Product pages is in norpricesupport.js.

Look for line:

Code: Select all

     return val[1] + val[2] + val[3] + getalt(thisval, formatted) + val[4];	// return potentially converted text
And change to:

Code: Select all

      return getalt(thisval, formatted) + val[4];	// return potentially converted text
The formatting around the price is done by the lines:

Code: Select all

   if ( exchange > hidefraction )
     {
     return prefix + ' (' + optplus + CommaFormatted(Math.round(altprice)) + ' ' + isoname + ')' + suffix;
     }
   else
     {
     return prefix + ' (' + optplus + CommaFormatted(topounds(altprice)) + ' ' + isoname + ')' + suffix;
     }
So to remove the brackets, amend to be:

Code: Select all

   if ( exchange > hidefraction )
     {
     return prefix + optplus + CommaFormatted(Math.round(altprice)) + ' ' + isoname + suffix;
     }
   else
     {
     return prefix  + optplus + CommaFormatted(topounds(altprice)) + ' ' + isoname + suffix;
     }
Also change the CSS in layout NorPrice Support which is currently:

Code: Select all

.altprice {font-size: xx-small; color: blue;}
To say

Code: Select all

.altprice {}
To fix the Cart display patches would be needed to ActinicOrder.pm

Look for

Code: Select all

			if ( $exchange > '<actinic:variable name="HIDEFRACTIONRATE" />' )
				{
				$sFormattedPrice .= ' (' . CommaFormatted(int($nNorprice + .5 * ($nNorprice <=> 0))) . " $iso)";
				}
			else
				{
				$sFormattedPrice .= ' (' . CommaFormatted(sprintf("%1.2f", $nNorprice)) . " $iso)";
				}
And change to:

Code: Select all

			if ( $exchange > '<actinic:variable name="HIDEFRACTIONRATE" />' )
				{
				$sFormattedPrice = CommaFormatted(int($nNorprice + .5 * ($nNorprice <=> 0))) . " $iso";
				}
			else
				{
				$sFormattedPrice = CommaFormatted(sprintf("%1.2f", $nNorprice)) . " $iso";
				}
Norman
Post Reply