Announcement

Collapse
No announcement yet.

Displaying the Attribute swatches first

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

  • Displaying the Attribute swatches first

    Seems like I cannot display this snippet of code

    Code:
    <mvt:if expr="g.hasSwatches">
              <div class="column whole product-swatches">
                <label class="medium">&mvte:global:swatch_prompt;</label>
                <span id="js-swatch-name" class="bold swatch-name">&nbsp;</span>
                <hr noshade />
                <div id="js-swatches"></div>
              </div>
            </mvt:if>
    before this snippet of code

    Code:
     <mvt:item name="product_attributes" param="product:id" />
    Is it going to take a bunch of CSS to get to appear before the rest of the attributes?

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

    Email me: leslie@lesliekirk.com
    www.lesliekirk.com

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

  • Hi Leslie,

    The section to display the swatches relies on a global variable which is set within the product attributes block. Is you make that check outside of the attributes, you could place the swatches where you like.
    Matt Zimmermann
    Director of UI/UX Standards and Theme Development
    / Miva, Inc.

    Comment


    • Originally posted by Matt Zimmermann View Post
      Hi Leslie,

      The section to display the swatches relies on a global variable which is set within the product attributes block. Is you make that check outside of the attributes, you could place the swatches where you like.
      So I thought maybe I understood this and tried

      Code:
      <div id="js-product-attributes" class="column whole product-attributes">
      <mvt:if expr="l.settings:attribute:type EQ 'swatch-select'">
          <mvt:assign name="g.hasSwatches" value="'1'" />
           <mvt:if expr="g.hasSwatches">
                <div class="column whole product-swatches">
                  <label class="medium">&mvte:global:swatch_prompt;</label>
                  <span id="js-swatch-name" class="bold swatch-name">&nbsp;</span>
                  <hr noshade />
                  <div id="js-swatches"></div>
                </div>
              </mvt:if>
          </mvt:if>
                <mvt:item name="product_attributes" param="product:id" />
              </div>
      That failed miserably and also killed the swatches.

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

      Email me: leslie@lesliekirk.com
      www.lesliekirk.com

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

      Comment


      • You would still need the attributes loop to have the conditional work.
        Matt Zimmermann
        Director of UI/UX Standards and Theme Development
        / Miva, Inc.

        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