Announcement

Collapse
No announcement yet.

Use both legacy and image machine product images...?

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

    Use both legacy and image machine product images...?

    Sorry if this is in the wrong place, I'm new to a lot this. We have a very old store, and I'm looking to tweak the product display layout in a way that I can show an image machine main image if it's there, but then fallback to the legacy images when it isn't there.

    Here is the current code showing the image as far as I can tell:
    Code:
    <div class="product-details-1">
        <mvt:if expr="NOT ISNULL l.settings:product:image">
        <div class="product-image"><img id="main_image" src="&mvte:product:image;" alt="&mvte:product:name;" /></div>
        <mvt:else>
        <div class="image-not-available product-image"></div>
        </mvt:if>
    If anyone who could point me in the right direction that'd be awesome
    Can this be done with an if statement?
    Last edited by teedle; 10-25-17, 12:06 PM. Reason: tags

    #2
    • In your administration portal, navigate to Utility Settings -> Add/Remove Modules and install Product Image Custom Fields.
    • Navigate to User Interface -> Image Types and add an image type with a code of main and description of Main
    • Navigate to User Interface -> Pages -> PROD -> Product Display Layout
    • Select Main Image from the Custom Fields list
    • In the layout code, modify your IF statement like this:
      Code:
      	<div class="product-details-1">
      	    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:productimagecustomfields:main">
      	        <div class="product-image"><img id="main-image" src="graphics/en-US/cssui/blank.gif" alt="&mvte:product:name;" title="&mvte:product:name;" /></div>
      	    <mvt:elseif expr="NOT ISNULL l.settings:product:image">
      	        <div class="product-image"><img id="main_image" src="&mvte:product:image;" alt="&mvte:product:name;" /></div>
      	    <mvt:else>
      	        <div class="image-not-available product-image"></div>
      	    </mvt:if>
      	    <mvt:item name="product_display_imagemachine" param="body:product:id" />
      
      
      	    ........
      	</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

    Working...
    X