Announcement

Collapse
No announcement yet.

Levels > OUS1 > Main Image

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

    Levels > OUS1 > Main Image

    I don't see the main image (from the product|image tab) on my upsell pages and wonder if someone that has it working can point to the latest code to show the image on that page so I can verify that I didn't muck it up at some point.

    #2
    The upsell page does not access the image types by default. You can add this code to the page to display the main image though.
    Code:
    <mvt:do file="g.Module_Library_DB" name="l.success" value="ImageType_Load_Code('main', l.settings:imagetype)" />
    <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:product:id, 1, l.settings:imagetype)" />
    <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)" />
    <mvt:if expr="NOT ISNULL l.settings:imagedata:image">
        <img src="&mvte:imagedata:image;" alt="&mvte:upsale:name;" title="&mvte:upsale:name;">
    </mvt:if>
    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
      Matt does a particular item (from the Items tab) need to be added to the OUS1 page to support this code?

      Comment


        #4
        No, this code functions natively.
        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
          It's dynamic so this should support whatever product is assigned to the upsell condition. IOW, doesn't need to be a single upsell item. It's the single item that matches the criteria for an existing item in the basket.

          Scott

          OOps, I think I interpreted "item" differently than you meant. I can't think of any API functions that require an item assigned to the page.
          Last edited by ids; 10-12-18, 09:07 AM.
          Need to offer Shipping Insurance?
          Interactive Design Solutions https://www.myids.net
          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
          Competitive Rates, Custom Modules and Integrations, Store Integration
          AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
          My T-shirt Collection is mostly MivaCon T-shirts!!

          Comment


            #6
            Code:
                  <div class="column whole medium-half product-information--images">
                    <mvt:if expr="NOT ISNULL l.settings:upsale:thumbnail">
                      <img src="&mvte:upsale:thumbnail;" alt="&mvte:upsale:name;" />
                    <mvt:else>
                       <mvt:do file="g.Module_Library_DB" name="l.success" value="ImageType_Load_Code('main', l.settings:imagetype)" />
                       <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:product:id, 1, l.settings:imagetype)" />
                       <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)" />
            
                    <mvt:if expr="NOT ISNULL l.settings:imagedata:image">
                         <img src="&mvte:imagedata:image;" alt="&mvte:upsale:name;" title="&mvte:upsale:name;">
                   <mvt:else>
                     test: main image not found
                    </mvt:if>
                    </mvt:if>
                  </div>
                  <!-- end product-information--images -->
            Here is the code I tried. It fires the mvt:else test > it is not seeing the main image. If I add a thumbnail under Legacy Images it shows that thumbnail, but otherwise the Main image under 'Images' does not show.

            Comment


              #7
              Try this:
              Code:
              <div class="column whole medium-half product-information--images">
                  <mvt:if expr="NOT ISNULL l.settings:upsale:thumbnail">
                      <img src="&mvte:upsale:thumbnail;" alt="&mvte:upsale:name;"/>
                  <mvt:else>
                      <mvt:do file="g.Module_Library_DB" name="l.success" value="ImageType_Load_Code('main', l.settings:imagetype)"/>
                      <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:product:id, l.settings:imagetype:id, l.settings:imagetype)"/>
                      <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)"/>
              
                      <mvt:if expr="NOT ISNULL l.settings:imagedata:image">
                          <img src="&mvte:imagedata:image;" alt="&mvte:upsale:name;" title="&mvte:upsale:name;">
                      <mvt:else>
                          test: main image not found
                      </mvt:if>
                  </mvt:if>
              </div>
              <!-- end product-information--images -->
              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


                #8
                That did it Matt - thanks a million. Not sure what you changed but it works. Might want to add this to your code samples page.

                Comment


                  #9
                  I'm glad it worked for you. Actually, I forgot to change the ID of the image type to a variable instead of it being static, just in case the main image was not ID 1.
                  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


                    #10
                    This is a partial (div) of what I have on a production site using LEVELs RT:

                    Code:
                    <div class="column whole medium-half product-information--images">
                        <mvt:if expr="NOT ISNULL l.settings:upsale:thumbnail">
                            <img src="&mvte:upsale:thumbnail;" alt="&mvte:upsale:name;" />
                        <mvt:else>
                          <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:upsale:id, 1, l.settings:imagetype)" />
                          <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)" />
                          <mvt:assign name="g.thisUpsaleImage" value="g.baseurl $ l.settings:imagedata:image" />
                    
                            <img src="&mvte:global:thisUpsaleImage;" alt="&mvte:upsale:name;" />
                        </mvt:if>
                    Like your's...checks only for the thumbnail else loads the "main" image.

                    Scott
                    Need to offer Shipping Insurance?
                    Interactive Design Solutions https://www.myids.net
                    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                    Competitive Rates, Custom Modules and Integrations, Store Integration
                    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
                    My T-shirt Collection is mostly MivaCon T-shirts!!

                    Comment


                      #11
                      Looks like Matt got to it first.

                      Scott
                      Need to offer Shipping Insurance?
                      Interactive Design Solutions https://www.myids.net
                      MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                      Competitive Rates, Custom Modules and Integrations, Store Integration
                      AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
                      My T-shirt Collection is mostly MivaCon T-shirts!!

                      Comment


                        #12
                        Thank you.

                        Comment

                        Working...
                        X