Display Variant Inventory Quantities on Product Page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • greggc
    Mivite


    • Mar 2006
    • 296

    #1

    Display Variant Inventory Quantities on Product Page

    I am trying to display inventory variant quantities on the product page. Products with no attributes show the products inventory quantities correctly with the following code;

    <mvt:if expr="l.settings:product:inv_active OR l.settings:attributemachine:product:inv_active">
    <div id="inventory-message" class="column whole">
    &mvt:product:inv_long;</mvt:if>

    It does not show inventory variant quantities however. What am i missing?
  • Matt Zimmermann
    Mega Mivite










    • Apr 2008
    • 2482

    #2
    If you move the IF statement to within the DIV, I believe you will get the results you are looking for.
    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

    • greggc
      Mivite


      • Mar 2006
      • 296

      #3
      This is where the if statement is located;

      <div class="row">
      <mvt:if expr="l.settings:product:inv_active OR l.settings:attributemachine:product:inv_active">
      <div id="inventory-message" class="column whole">
      &mvt:product:inv_long;</mvt:if>
      <div id="js-product-attributes" class="column whole product-attributes">
      <mvt:item name="product_attributes" param="product:id" />
      </div>
      <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>
      </div>

      Is this what you are referring too?

      Comment

      • Matt Zimmermann
        Mega Mivite










        • Apr 2008
        • 2482

        #4
        Yes, try updating it to this:
        Code:
        <div class="row">
            <div id="inventory-message" class="column whole">
                <mvt:if expr="l.settings:product:inv_active OR l.settings:attributemachine:product:inv_active">
                    &mvt:product:inv_long;
                </mvt:if>
            </div>
            <div id="js-product-attributes" class="column whole product-attributes">
                <mvt:item name="product_attributes" param="product:id"/>
            </div>
            <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>
        </div>
        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

        • greggc
          Mivite


          • Mar 2006
          • 296

          #5
          Thanks for the help, but still not displaying.

          Comment

          • Matt Zimmermann
            Mega Mivite










            • Apr 2008
            • 2482

            #6
            Are you receiving any inventory messages or just not the information you are looking for?
            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

            • greggc
              Mivite


              • Mar 2006
              • 296

              #7
              None at all. It works on products with no attributes but not on products with attributes that have been generated as inventory variants.

              Comment

              • Matt Zimmermann
                Mega Mivite










                • Apr 2008
                • 2482

                #8
                On products with variants, do the variants have inventory values and is the master product set to not track inventory?
                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

                • greggc
                  Mivite


                  • Mar 2006
                  • 296

                  #9
                  Yes sir

                  Comment

                  • Matt Zimmermann
                    Mega Mivite










                    • Apr 2008
                    • 2482

                    #10
                    Can you post a link to the site?
                    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

                    • greggc
                      Mivite


                      • Mar 2006
                      • 296

                      #11
                      It is a dev site. We are updating to the Iron & Wool theme. Would it be better to just open a ticket?

                      Comment

                      • Matt Zimmermann
                        Mega Mivite










                        • Apr 2008
                        • 2482

                        #12
                        Yeah, Support should be able to get you going.
                        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