Announcement

Collapse
No announcement yet.

Read an image

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

    Read an image

    Currently I am using this code to test a product for an image:

    <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:i d, 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">


    Is there a more streamlined code that can be used for this purpose?

    #2
    Where is that code being used? If this is on the product page, there is definitely an easier/better way.

    That code is loading the main image type then loading the image for the product of type main. But all that data is already available for you if on the Product page,
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Yes, it is on the prod page

      Comment


        #4
        If you are on the PROD template you will be able to access the main image using this variable
        Code:
        l.settings:product:customfield_values:productimagecustomfields:main
        if you have the Main image type selected in the custom fields settings of the Product Display Layout:

        imagetype.JPG
        Attached Files
        Nicholas Adkins
        Technical Training Specialist / Miva, Inc.
        [email protected]
        https://www.miva.com/mivalearn

        Comment


          #5
          Thanks Nick. Perfect

          Comment

          Working...
          X