Announcement

Collapse
No announcement yet.

Base Readytheme / PROD page template / No image avaialable

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

    Base Readytheme / PROD page template / No image avaialable

    I have tried a bunch of different ways, and [head pounding on keyboard] I want to display an image in case the product does not have a main image assigned or no image at all:

    This is the base readytheme for the PROD page template >> Product Display Layout main image:

    Code:
                    <div class="product-image">
                        <img src="graphics/en-US/cssui/blank.gif" alt="&mvte:product:name;" title="&mvte:product:name;" id="main_image" class="aligncenter" />
                    </div>
                    <ul id="thumbnails" class="thumbnails"></ul>
    On the next three below that I've tried, all PROD page images were 'no image available' even if they previously displayed their correct image, and of course, the ones that didn't have images still have that 'no image available' image:

    Code:
    <mvt:if expr="NOT ISNULL l.settings:product:imagetypes:main">
                        <div class="product-image"><img src="graphics/en-US/cssui/blank.gif" alt="&mvte:product:name;" title="&mvte:product:name;" id="main_image" class="aligncenter" /></div>
                    <mvt:else>
                        <div class="product-image"><a href="&mvte:product:link;"><img src="graphics/00000001/NO_IMG-270x270.jpg" alt="&mvte:product:name;" class="img-responsive" /></a></div>
                    </mvt:if>
    
    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:productimagecustomfields:main">
                        <img src="graphics/en-US/cssui/blank.gif" alt="&mvte:product:name;" title="&mvte:product:name;" id="main_image" class="aligncenter" />            
                    <mvt:else>
                        <div class="product-image"><img src="graphics/00000001/NO_IMG-270x270.jpg" alt="No image available"></div>
                    </mvt:if>
    
    ---Yep, custom field assigned on the above and below ---
    
    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:productimagecustomfields:main">
                        <div class="product-image"><img src="&mvt:product:image;" alt="&mvt:product:name;" /></div>            
                    <mvt:else>
                        <div class="product-image"><img src="graphics/00000001/NO_IMG-270x270.jpg" alt="No image available"></div>
                    </mvt:if>
    On the below, PROD page image displays on products that actually have images, but the 'no image available' image does not display on products that have no image:

    Code:
                    <mvt:if expr="NOT ISNULL l.settings:product:image">
                        <div class="product-image"><img src="graphics/en-US/cssui/blank.gif" alt="&mvte:product:name;" title="&mvte:product:name;" id="main_image" class="aligncenter" /></div>        
                    <mvt:else>
                        <div class="product-image"><img src="graphics/00000001/NO_IMG-270x270.jpg alt="&mvte:product:name;" title="&mvte:product:name;" id="main_image" class="aligncenter" /></div>
                    </mvt:if>
    Currently delirious...

    Thank you in advance for any advice!

    Jamie
    Jamie Donaldson
    JSDVS Web Design / Development
    Web Design | Web Development | E-commerce Design & Integration

    #2
    Re: Base Readytheme / PROD page template / No image avaialable

    No one huh? Just for kicks, I tried it with custom field Image Type: Main assign and not assigned...no dice.

    Sure would like to know the answer to this....

    Jamie
    Jamie Donaldson
    JSDVS Web Design / Development
    Web Design | Web Development | E-commerce Design & Integration

    Comment


      #3
      Re: Base Readytheme / PROD page template / No image avaialable

      Most of the people who could answer this from my team were at IRCE all week, I'll get you an answer on Monday.
      Thanks,

      Rick Wilson
      CEO
      Miva, Inc.
      [email protected]
      https://www.miva.com

      Comment


        #4
        Re: Base Readytheme / PROD page template / No image avaialable

        Originally posted by Rick Wilson View Post
        Most of the people who could answer this from my team were at IRCE all week, I'll get you an answer on Monday.
        Thank you so much, Rick! I'll look for it then. Your response is greatly appreciated!

        Jamie
        Jamie Donaldson
        JSDVS Web Design / Development
        Web Design | Web Development | E-commerce Design & Integration

        Comment


          #5
          Re: Base Readytheme / PROD page template / No image avaialable

          So will I Rick, just like Jamie above, I have looked and Looked. My eyes are blacked from hitting my head on the Keyboard. Somewhere there must be documentation which defines how to build a readytheme image!

          Looking Forward to Monday
          Dave C.
          Dave C
          The Window Technicians, Inc.
          Andersen Window and Door Hardware
          http://www.parts-aw.com

          Comment


            #6
            Re: Base Readytheme / PROD page template / No image avaialable

            Code:
            <mvt:if expr="NOT ISNULL l.settings:product:image">
            Not anticipating it will answer the question and my thought may help in eliminating issues from the discussion. But for clarification, this line isn't checking to see if an image actually exists in a said location. All this is doing is evaluating if the variable "l.settings:product:image" has a value or not. So, if that line evaluates as TRUE, then this specific branch will execute. Otherwise it will fall through to the next branch which is an ELSE or ELSEIF or pass through if there are no other conditional branches.

            Bottom line is that images may exist in the correct folder but if the variables have an incorrect value you'll get a NULL (as in nothing -- not blank.gif) rendering.

            Suggestion for eliminating a bad path and filename: Render the images outside the conditionals. Or, EVAL the contents of the variable l.settings:product:image -- which in this case should be a null or an image filename.

            Scott
            Last edited by ids; 06-08-15, 08:37 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


              #7
              Re: Base Readytheme / PROD page template / No image avaialable

              Having access to variables in the template language for images is dependent on images having imagetypes. Typically we check for the image type of "main" and if that does not exist we fallback to the legacy fullsize image, and if that does not exist we display a image not available.


              However this does not take into account an image without a type of main (or even no type at all)


              Code:
              <mvt:if expr="NOT ISNULL l.settings:product:imagetypes:main">
                 // image type main exists
              <mvt:elseif expr="NOT ISNULL l.settings:product:image">
                 // Legacy fullsize image exists
              <mvt:else>
                // Neither of the image above exist, display no image available
              </mvt:if>

              You may be able to try the code below. There is a global variable that has an array of all images, whether they have a type of not. Something like this may work:


              Code:
              <mvt:if expr="miva_array_elements(g.session:cache:productimagecustomfields:productimage:imagedata) GT 0">
                 // There is at least 1 image for this product
              <mvt:elseif expr="NOT ISNULL l.settings:product:image">
                 // Legacy fullsize image exists
              <mvt:else>
                // Neither of the image above exist, display no image available
              </mvt:if>
              Last edited by Brennan; 06-08-15, 09:57 AM.
              Brennan Heyde
              VP Product
              Miva, Inc.
              [email protected]
              https://www.miva.com

              Comment


                #8
                Re: Base Readytheme / PROD page template / No image avaialable

                Originally posted by ids View Post
                <mvt:if expr="NOT ISNULL l.settings:product:image"> Scott
                Yeah...that is one I found somewhere in my travels for a solution. Too delirious to tell you where now.

                Jamie
                Jamie Donaldson
                JSDVS Web Design / Development
                Web Design | Web Development | E-commerce Design & Integration

                Comment


                  #9
                  Re: Base Readytheme / PROD page template / No image avaialable

                  Hi All,

                  Have read the above respones several times, but don't see a real answer let. Not sure how you feel Jamie as this is your initial Post. I when I see several lines of code presented as a fix I start wondering what other folks who are using Suivant have encountered. I have most of my images set to "main" but that didn't help display product images on the Product Page. They do display on the Product List Page and if I change the image type to say "head" they do not display. So some parts of the Image Machine is working I guess.
                  Dave C
                  The Window Technicians, Inc.
                  Andersen Window and Door Hardware
                  http://www.parts-aw.com

                  Comment


                    #10
                    Re: Base Readytheme / PROD page template / No image avaialable

                    Dave,

                    If you set your image type to main and it's not working, something else is likely wrong. You may want to open a ticket.
                    Thanks,

                    Rick Wilson
                    CEO
                    Miva, Inc.
                    [email protected]
                    https://www.miva.com

                    Comment


                      #11
                      Re: Base Readytheme / PROD page template / No image avaialable

                      Thanks Rick and I will do that.
                      Dave C
                      The Window Technicians, Inc.
                      Andersen Window and Door Hardware
                      http://www.parts-aw.com

                      Comment


                        #12
                        Re: Base Readytheme / PROD page template / No image avaialable

                        Originally posted by dcatel View Post
                        Suivant .... I have most of my images set to "main" but that didn't help display product images on the Product Page.
                        Hi dcatel,

                        Not sure how Suviant goes either, but for the base readytheme, the below is how it was originally set up on the PROD page >> Product Display layout for the image:

                        Code:
                                        <div class="product-image">
                                            <img src="graphics/en-US/cssui/blank.gif" alt="&mvte:product:name;" title="&mvte:product:name;" id="main_image" class="aligncenter" />
                                        </div>
                                        <ul id="thumbnails" class="thumbnails"></ul>
                        Not sure how that got the correct image for the product image on the PROD page, but it displayed the correct image that was assigned an image type of main.

                        All I can say is try putting that in the Product Display Layout section and see if your product image displays.

                        I am going on to Brennans' post next to see if I can work his response into an answer for mine and also to see if I can understand it. [too much keyboard banging...my brain is still delirious]. I'll post up on that next I hope.

                        Sorry I am not much more help to you dcatel.

                        Jamie
                        Jamie Donaldson
                        JSDVS Web Design / Development
                        Web Design | Web Development | E-commerce Design & Integration

                        Comment


                          #13
                          Re: Base Readytheme / PROD page template / No image avaialable

                          Originally posted by Brennan View Post
                          Having access to variables in the template language for images is dependent on images having imagetypes. Typically we check for the image type of "main" and if that does not exist we fallback to the legacy fullsize image, and if that does not exist we display a image not available.
                          Okay, yes, image type main is assigned to all images that require that image type, which is the primary image on the PROD page.

                          But, the code that came with my base readytheme was only:

                          Code:
                          <div class="product-image">
                                              <img src="graphics/en-US/cssui/blank.gif" alt="&mvte:product:name;" title="&mvte:product:name;" id="main_image" class="aligncenter" />
                                          </div>
                                          <ul id="thumbnails" class="thumbnails"></ul>
                          So there was no code to fall back to the legacy image, which is fine, since legacy images are not used in this site, so I don't care if that is even present. But, the above was giving me the correct image. I am confused as to why that blank.gif is finding the image type main. Maybe I don't need to know at this point.


                          Originally posted by Brennan View Post

                          However this does not take into account an image without a type of main (or even no type at all)


                          Code:
                          <mvt:if expr="NOT ISNULL l.settings:product:imagetypes:main">
                             // image type main exists
                          <mvt:elseif expr="NOT ISNULL l.settings:product:image">
                             // Legacy fullsize image exists
                          <mvt:else>
                            // Neither of the image above exist, display no image available
                          </mvt:if>
                          Okay, since I need no legacy fallback image, I should be able to do it by modifying your code above with the results as follows :

                          Code:
                          
                          <mvt:if expr="NOT ISNULL l.settings:product:imagetypes:main">
                              <div class="product-image"><img src="&mvte:product:imagetypes:main;" alt="&mvte:product:name;" title="&mvte:product:name;" /></div>
                          <mvt:else>
                              <div class="product-image"><img src="graphics/00000001/NO_IMG-270x270.jpg" alt="&mvte:product:name;" title="&mvte:product:name;" /></div>
                          </mvt:if>
                          I add the Image type Main under Product Display layout, but that changes the image type main, which used to be displayed on the PROD page to the no_img jpg for all products.

                          If I do not add that image type main as a custom field under the Product Display Layout, no image displays at all.

                          So...I am lost on that one.

                          Originally posted by Brennan View Post
                          You may be able to try the code below. There is a global variable that has an array of all images, whether they have a type of not. Something like this may work:


                          Code:
                          <mvt:if expr="miva_array_elements(g.session:cache:productimagecustomfields:productimage:imagedata) GT 0">
                             // There is at least 1 image for this product
                          <mvt:elseif expr="NOT ISNULL l.settings:product:image">
                             // Legacy fullsize image exists
                          <mvt:else>
                            // Neither of the image above exist, display no image available
                          </mvt:if>
                          I am not even sure how to use the above, since I'd also want to get rid of the fallback legacy image totally and I am using the image type of main.


                          Sorry I am just not getting it, Brennan and am about to give up and just let it go.

                          Jamie
                          Jamie Donaldson
                          JSDVS Web Design / Development
                          Web Design | Web Development | E-commerce Design & Integration

                          Comment


                            #14
                            Re: Base Readytheme / PROD page template / No image avaialable

                            This does not work. Instead of getting the product image on the PROD page, I get the no image displayed on all products that do have an image.

                            Code:
                            <mvt:if expr="miva_array_elements(g.session:cache:productimagecustomfields:productimage:imagedata) GT 0">
                               <img src="graphics/en-US/cssui/blank.gif" alt="&mvte:product:name;" title="&mvte:product:name;" id="main_image" class="aligncenter" />
                            <mvt:elseif expr="NOT ISNULL l.settings:product:image">
                               There is no legacy image
                            <mvt:else>
                              <img src="graphics/00000001/NO_IMG-270x270.jpg" alt="&mvte:product:name;" title="&mvte:product:name;" />
                            </mvt:if>
                            I think I am a glutton for punishment, but I know there must be a way to do what I want. Maybe the above as I have it is incorrect...

                            Jamie
                            Jamie Donaldson
                            JSDVS Web Design / Development
                            Web Design | Web Development | E-commerce Design & Integration

                            Comment


                              #15
                              Re: Base Readytheme / PROD page template / No image avaialable

                              If you're still having issue, Private Message me access to your store and I can take a look.
                              Brennan Heyde
                              VP Product
                              Miva, Inc.
                              [email protected]
                              https://www.miva.com

                              Comment

                              Working...
                              X