Announcement

Collapse
No announcement yet.

Need to display a related product more than once on a product page

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

    Need to display a related product more than once on a product page

    I'm displaying related products in groups based on a custom product field. But having some trouble with the images.

    (first group)
    <mvt:foreach iterator="product" array="related_products:products">
    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields :ENGLISH">
    <img id="main_image_&mvte:product:id;" src="graphics/en-US/cssui/blank.gif" alt="&mvte:product:name;" />
    <mvt:item name="related_products_imagemachine" param="body:product:id" />
    </mvt:if>
    </mvt:foreach>

    (second group)
    <mvt:foreach iterator="product" array="related_products:products">
    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields :GREEK">
    <img id="main_image_&mvte:product:id;" src="graphics/en-US/cssui/blank.gif" alt="&mvte:product:name;" />
    <mvt:item name="related_products_imagemachine" param="body:product:id" />
    </mvt:if>

    A few related products fall into both groups so they are listed twice. The product image works the first time it's listed but doesn't show up the next time. I assume it's related to the image ID. Does anyone have a suggestion on how to work around this and get the image to display multiple times?
    Gary

    [email protected]
    www.icCommerce.com

    #2
    You're trying to call image machine twice on the page which isn't going to work. You only need image machine if you need swatches or the ability to display multiple images. If you just want the image to show up, unassign the related_product_imagemachine item, remove the <mvt:item name="related_products_imagemachine" param="body:product:id" /> and instead under the related products list layout tab, you'll see a drop down to assign the image to display. Set this to main then you can reference the main image like this:

    Code:
    <mvt:if expr="NOT ISNULL l.settings:product:imagetypes:main">
        <img src="&mvte:product:imagetypes:main;" alt="&mvte:product:name;" title="&mvte:product:name;" />
    <mvt:else>
        <img src="&mvte:global:theme_path;/images/img_no_thumb.jpg" alt="&mvte:product:name;" title="&mvte:product:name;" />
    </mvt:if>
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      That solved the problem.
      Thanks
      Gary

      [email protected]
      www.icCommerce.com

      Comment

      Working...
      X