Announcement

Collapse
No announcement yet.

Javascript & NETQUOTEVARS

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

    Javascript & NETQUOTEVARS

    Hi,

    I'm trying to use some javascript to display the saving made by a customer. Is there a way to pass the values of a Netquotevar & customvar into a javascript function & then return a result?

    #2
    Okay, I've had a bit of a play and I can pass values in/out easily enough. The problem now is that NETQUOTEVAR:PRODUCTPRICE includes lots of text, is there a NETQUOTEVAR that just has a numerical value for price?

    Comment


      #3
      Put the JavaScript into Act_ProductPrice.html where it can pick up just NETQUOTEVAR:COST for example.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        The NETQUOTEVAR:COST still includes a £ sign so confuses the calculations. Is there a way of extracting the numerical value only?

        Comment


          #5
          Hi there

          No i am afraid not, but could you not implement something within the javascript to disregard the "£" when it reads it in?

          Kind Regards
          Nadeem Rasool
          SellerDeck Development

          Comment


            #6
            This should be enough to get a true number
            Code:
             var cost = 'NETQUOTEVAR:COST';
             cost = cost.replace(/,|£|$/g,"");	// remove all commas, £ and $ 
             cost = cost.replace(/./g,".");    		// restore decimal point
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Thanks guys, I got there in the end.

              I eventually added the javascript to Act_ProductPrice with an if/else statement so a message will only display for discounted items (RRP=£xxxx, Saving=£xxxx).

              Comment

              Working...
              X