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

  • Hi Leslie,

    Try replacing the 'else' eval with this:
    Code:
    &nbsp;<mvt:eval expr="' -$' $ glosub(rnd(l.settings:option:price, 2), '-', '')" />
    Matt Zimmermann
    Director of UI/UX Standards and Theme Development
    / Miva, Inc.

    Comment


    • 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

      This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

      This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

      Accept