Announcement

Collapse
No announcement yet.

Attributes Double Negative

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

    Attributes Double Negative

    How can I fix the double negative that the PROD Page Product Attribute Template displays with a negative value attribute?



    Aesthetically, the second negative looks bad. I can see the coding that needs to be tweaked, I just don't know how to get rid of the second - that comes from the attribute price.

    Code:
    <mvt:if expr="l.settings:option:price GT 0">
                                        &nbsp;<mvt:eval expr="'+ $' $ rnd(l.settings:option:price, 2)" />
                                    <mvt:else>
                                        &nbsp;<mvt:eval expr="'- $' $ rnd(l.settings:option:price, 2)" />
                                    </mvt:if>
    Also, in the example, the product price is $14.30, but selecting the -$4.30 attribute does not change the product price to $10.00.

    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    #2
    Hi Leslie,

    Try replacing the 'else' eval with this:
    Code:
    &nbsp;<mvt:eval expr="' -$' $ glosub(rnd(l.settings:option:price, 2), '-', '')" />
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      Thanks, Matt - that fixed it.
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

      Comment

      Working...
      X