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 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,

    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

    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
      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 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


        #4
        You would still need the attributes loop to have the conditional work.
        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

        Working...
        X