Announcement

Collapse
No announcement yet.

Removing pence/cents from a displayed price

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

    Removing pence/cents from a displayed price

    Hi

    In the V6 forum, Norman kindly identified a method of using JavaScript to strip off the pence/cents from a displayed price.

    For example, I would like to display the pricing in the main catalog area in the form £1,000 / $1,870 rather than the default form £1,000.00 / $1,870.00.

    I have studied the V6 solution with care and cannot get it to work correctly on my V7 site where I have dual GBP and USD pricing. The symptoms are that the price/cents remain present in the catalog preview displays.

    The script that Norman proposed in the thread was:-

    <!--
    document.write("NETQUOTEVAR:COST".replace(/&amp;#46;\d\d/,""));
    // -->
    </script>
    <noscript>NETQUOTEVAR:COST</noscript>

    Any help on this point would be very much appreciated and I apologise if I have mis-understood something.

    Thank you for such a superb community forum,

    John.

    #2
    Ignore. Sorry.
    http://www.johnsons-seeds.com - Actinic plugins, remote add to cart and custom CMS
    http://www.dtbrownseeds.co.uk - More seeds and plants....
    http://www.mr-fothergills.co.uk - Well it used to be Actinic...

    Comment


      #3
      Hi John,

      Why don't you contact Norman regarding this, he may do the change for a fee, due to the fact that it will involve changes to the perlscript. His website address is: http://www.drillpine.biz.

      Kind Regards
      Nadeem Rasool
      SellerDeck Development

      Comment


        #4
        It's the Form munging things.

        Try
        Code:
        <script language=JavaScript>
        <!--
        document.write("NETQUOTEVAR:COST".replace(/&#38;#46;\d\d/g,""));
        // -->
        </script>
        <noscript>NETQUOTEVAR:COST</noscript>
        Which I've also extended to convert both currencies if used.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Success !!

          Hi Norman,
          Thank you so much for your assistance. The proposed code works superbly !!

          I have now worked out how the global string replace function works and will apply that method to some other aspects of my site.

          Many thanks again,
          John.

          Comment

          Working...
          X