Announcement
Collapse
No announcement yet.
Read an image
Collapse
X
-
If you are on the PROD template you will be able to access the main image using this variableCode:l.settings:product:customfield_values:productimagecustomfields:main
imagetype.JPGAttached Files
Leave a comment:
-
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,
Leave a comment:
-
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?Tags: None
Leave a comment: