Announcement

Collapse
No announcement yet.

Swatch Drop-down list being placed last?

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

    Swatch Drop-down list being placed last?

    I'm seeing this on Levels (as well as Iron & Wool) - why when I have a product with:

    - Swatch Drop-down List
    - Any other attributes

    The themes are placing the Swatch Drop-down list last, at the bottom of all attributes? Even when I have it at the top in attributes.

    Is this a bug? If not, is there a fix?

    -Kevin
    Web Design and Development, Internet Marketing
    Lancer Media, Inc.

    #2
    Hi Kevin,

    This is not a bug, just the way the ReadyTheme was designed. You could modify it by moving the conditional for swatches from the attribute template to the product display layout and move the swatches block to above the attribute block.
    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 Kevin,

      This is not a bug, just the way the ReadyTheme was designed. You could modify it by moving the conditional for swatches from the attribute template to the product display layout and move the swatches block to above the attribute block.
      Matt,

      Ok, so in the PROD page Product Attribute Template, I need to take the following section out?

      Code:
      <mvt:elseif expr="l.settings:attribute:type EQ 'swatch-select'">
      <mvt:assign name="g.hasSwatches" value="'1'" />
      <mvt:assign name="g.swatch_prompt" value="l.settings:attribute:prompt" />
      <div class="form-row all-hidden">
      <mvt:if expr="l.settings:attribute:required">
      <label for="js-swatch-select" title="&mvt:attribute:prompt;" class="medium">&mvt:attribute:prompt;</label>
      <mvt:else>
      <label for="js-swatch-select" title="&mvt:attribute:prompt;">&mvt:attribute:prom pt;</label>
      </mvt:if>
      <select name="Product_Attributes[&mvt:attribute:index;]:value" id="js-swatch-select" class="input-medium" data-attribute="&mvte:attribute:code;">
      <mvt:foreach iterator="option" array="attribute:options">
      <mvt:if expr="((g.Product_Attributes[l.settings:attribute:index]:value EQ 0) AND (l.settings:option:id EQ l.settings:attribute:default_id)) OR (g.Product_Attributes[l.settings:attribute:index]:value EQ l.settings:option:code)">
      <option value="&mvte:option:code;" data-option-price="&mvt:option:price;" data-regular-price="" selected>
      &mvte:option:prompt;
      <mvt:if expr="l.settings:option:price">
      <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>
      </mvt:if>
      </option>
      <mvt:else>
      <option value="&mvte:option:code;" data-option-price="&mvt:option:price;" data-regular-price="">
      &mvte:option:prompt;
      <mvt:if expr="l.settings:option:price">
      <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>
      </mvt:if>
      </option>
      </mvt:if>
      </mvt:foreach>
      </select>
      </div>

      If so, where in the Product Display template do I place this? Guessing I need to modify the elseif?

      And in the Product Display Template, I need to move this block:

      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>
      <div id="js-swatches"></div>
      </div>
      </mvt:if>
      To be above this block?

      Code:
      <div id="js-product-attributes" class="column whole product-attributes">
      <mvt:item name="product_attributes" param="product:id" />
      </div>
      Thanks.

      -Kevin

      Web Design and Development, Internet Marketing
      Lancer Media, Inc.

      Comment


        #4
        Hi Kevin,

        Once you move the blocks, place this code above the 'hasSwatches' conditonal:
        Code:
        <mvt:foreach iterator="attribute" array="attributes">
        <mvt:if expr="l.settings:attribute:type EQ 'swatch-select'">
        <mvt:assign name="g.hasSwatches" value="'1'" />
        <mvt:assign name="g.swatch_prompt" value="l.settings:attribute:prompt" />
        </mvt:if>
        </mvt:foreach>
        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


          #5
          Originally posted by Matt Zimmermann View Post
          Hi Kevin,

          Once you move the blocks, place this code above the 'hasSwatches' conditonal:
          Code:
          <mvt:foreach iterator="attribute" array="attributes">
          <mvt:if expr="l.settings:attribute:type EQ 'swatch-select'">
          <mvt:assign name="g.hasSwatches" value="'1'" />
          <mvt:assign name="g.swatch_prompt" value="l.settings:attribute:prompt" />
          </mvt:if>
          </mvt:foreach>

          Matt,

          Ok, placing that above the HasSwatches worked and moved the swatches above the other options.

          Do I need to remove anything from Product Attribute template? I left that large block in and it's working.

          -Kevin
          Web Design and Development, Internet Marketing
          Lancer Media, Inc.

          Comment


            #6
            No, everything else is fine as is.
            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


              #7
              Originally posted by Matt Zimmermann View Post
              No, everything else is fine as is.
              Matt,

              Thank you so much!! Appreciate the help and quick response.

              -Kevin
              Web Design and Development, Internet Marketing
              Lancer Media, Inc.

              Comment


                #8
                Thank you for bringing this up! I've been meaning to do the same thing.

                I'd really love if multiple swatch arrays could be on one product. We have a lot of furniture items which might have a choice of wood species and a choice of leather, for example.
                Dylan Buchfink
                The Mattress & Sleep Company
                http://www.tmasc.ca/

                Comment

                Working...
                X