Announcement

Collapse
No announcement yet.

NETQUOTEVAR:COST Manipulation.

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

    NETQUOTEVAR:COST Manipulation.

    I need to do some additional calculation to the numeric value stored in NETQUOTEVAR:COST, but as far as I can tell, NETQUOTEVAR:COST contains a '£' char as well, which obvisouly makes manipulating the value using math functions etc a bit more difficult.

    Is it possible to remove the preceding currency sign from the NETQUOTEVAR:COST variable, or am I completely off track and the currency sign is coming from somewhere other than NETQUOTEVAR:COST.

    Thanks!
    AdamL

    #2
    Not sure if theres a way to do this within Actinic, or an alternative NETQUOTEVAR, but assuming you're doing this in Javascript, load NETQUOTEVAR:COST into a variable and just chop the 1st character from the string (JS will automatically cast the string to a number when you perform a calculation). Only takes 2 lines:

    Code:
    var cost="NETQUOTEVAR:COST";
    cost=cost.substring(1,cost.length);
    www.gbradley.co.uk
    Web Development, Actinic Patches, Scripts & more

    Comment


      #3
      Hi Kermy, thanks for the reply

      Yes, its Javascript that I am using to manipulate the numbers.

      I have tried the method you suggest and this works fine, however, I can only get that working when the code is contained within the Act_ProductPrice.html template. I cant manipulate the NETQUOTEVAR:COST value with code contained within (or included in using NETQUOTEVAR:INCLUDE) the Act_ProductLine.html template.

      The calculation has to take place in the product line template as these calcuations are specific to a particluar product(or group of products), the problem with the template that is called by NETQUOTEVAR:PRODUCTPRICE is that as far as I can tell it is universal, that is that EVERY product price is generated from Act_ProductPrice.html.

      Im not sure if Ive explained that very well, but in a nutshell...

      If it is possible to have differant definable Act_ProductPrice.html templates then the method you suggest will work. If not, then I need to be able to use string manipulation on the full output of the NETQUOTEVAR:PRODUCTPRICE to extract the price from NETQUOTEVAR:RODUCTPRICE..... NOT NETQUOTEVAR:COST.

      Comment


        #4
        Check out Normans site at www.drillpine.biz where there is a hack for getting NQV's into templates that do not usually have access to them - you should then be able to get the NQV into the Act_productLine for your javascript


        Bikster
        SellerDeck Designs and Responsive Themes

        Comment


          #5
          This should work anywhere in a Product Template

          I've had to attach the code as this Forum munges certain JavaScript constructs.

          You'll have to make sure that all code in Act_ProductPrice.html is on one long line and that you have Compact HTML/CGI set in Design / Options / Miscellaneous.
          Attached Files
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment

          Working...
          X