Announcement

Collapse
No announcement yet.

Specific Size Variant Main Image in Feed Template

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

    Specific Size Variant Main Image in Feed Template

    I am using the following code to generate specific sized images for the feeds. It works fine for parent and normal records, but not for variants. What am I missing?

    Code:
    <mvt:ifexpr="NOT ISNULL l.settings:record:variant">
    
    <mvt:assignname="l.constraints[1]:height"value="540" />
    <mvt:assignname="l.constraints[1]:width"value="540" />
    <mvt:assignname="l.imagetype_codes[1]"value="'main'" />
    
    <mvt:assignname="l.constraints_count"value="miva_array_elements( l.constraints )" />
    <mvt:assignname="l.imagetypecode_count"value="miva_array_elements( l.imagetype_codes )" />
    
    <mvt:dofile="g.Module_Library_DB"name="l.imagedata_count"value="ProductImageDataList_Load_Product_TypeCodes_Const rained(l.settings:record:variant:id, l.imagetype_c odes, l.imagetypecode_count , l.constraints,l.cons traints_count,l.settings:productimagedatalist)" />
    
        &mvt:record:variant:code;,&mvt:record:variant: name;,&mvt:record:variant:weight;,<mvt:ifexpr="ISNULL l.settings:productimagedatalist[1]:generatedimages[1]:image"><mvt:dofile="g.Module_Library_DB"name="l.ok"value="GeneratedImage_FindOrInsert_Image_Dimensions( l.s ettings:productimagedatalist[1]:image, l.constraints[1]:width, l.constraints[1]:height, l.settings:generatedimage )" />https://domain.com/Merchant5/&mvt:generatedimage:image;<mvt:else>https://domain.com/Merchant5/&mvt:productimagedatalist[1]:generatedimages[1]:image;</mvt:if>,&mvt:record:variant:price;&mvt:eol:crlf;
    
    <mvt:else>
    
    <mvt:assignname="l.constraints[1]:height"value="540" />
    <mvt:assignname="l.constraints[1]:width"value="540" />
    <mvt:assignname="l.imagetype_codes[1]"value="'main'" />
    
    <mvt:assignname="l.constraints_count"value="miva_array_elements( l.constraints )" />
    <mvt:assignname="l.imagetypecode_count"value="miva_array_elements( l.imagetype_codes )" />
    
    <mvt:dofile="g.Module_Library_DB"name="l.imagedata_count"value="ProductImageDataList_Load_Product_TypeCodes_Const rained(l.settings:record:id, l.imagetype_codes, l. imagetypecode_count , l.constraints,l.constraints_ count,l.settings:productimagedatalist)" />
    
        &mvt:record:code;&mvt:record:name,&mvt:record: weight;,<mvt:ifexpr="ISNULL l.settings:productimagedatalist[1]:generatedimages[1]:image"><mvt:dofile="g.Module_Library_DB"name="l.ok"value="GeneratedImage_FindOrInsert_Image_Dimensions( l.s ettings:productimagedatalist[1]:image, l.constraints[1]:width, l.constraints[1]:height, l.settings:generatedimage )" />https://domain.com/Merchant5/&mvt:generatedimage:image;<mvt:else>https://domain.com/Merchant5/&mvt:productimagedatalist[1]:generatedimages[1]:image;</mvt:if>,&mvt:record:price;&mvt:eol:crlf;
    
    </mvt:if>

    #2
    Disregard. It works.

    Comment

    Working...
    X