html Miva - 生成选项图像

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html Miva - 生成选项图像相关的知识,希望对你有一定的参考价值。

<mvt:comment><!-- author: @mhegler --></mvt:comment>
<mvt:do file="g.Module_Library_DB" name="l.success" value="ImageType_Load_Code( 'main', l.imagetype:main )" />
<mvt:assign name="l.height" value="52" />
<mvt:assign name="l.width" value="52" />

<mvt:foreach iterator="attribute" array="attributes">
	<mvt:if expr="l.settings:attribute:type EQ 'radio' AND 'Color' IN l.settings:attribute:prompt">
		<mvt:foreach iterator="option" array="attribute:options">
			<mvt:comment><mvt:if expr="ISNULL l.settings:option:image"></mvt:comment>

				<mvt:comment> NULL Out Variables </mvt:comment>
				<mvt:assign name="l.settings:variants" value="NULL" />

				<mvt:do file="g.Module_Library_DB" name="l.success" value="ProductVariantList_Load_Product_Option(l.settings:product:id, l.settings:option:attr_id, l.settings:option:id, l.settings:variants)"/>
				<mvt:foreach iterator="variant" array="variants">
					
					<mvt:comment> NULL Out Variables </mvt:comment>
					<mvt:assign name="l.loaded_variants" value="NULL" />
					<mvt:assign name="l.loaded_type" value="NULL" />
					<mvt:assign name="l.imagedata" value="NULL" />
					<mvt:assign name="l.image" value="NULL" />
					<mvt:assign name="l.generated_image:image" value="NULL" />
					
					<mvt:do file="g.Module_Library_DB" name="l.success" value="ProductList_Load_Variant(l.settings:product:id, l.settings:variant:variant_id, l.loaded_variants)" />
					<mvt:if expr="l.loaded_variants[1]:id GT 0">
						
						<mvt:do file="g.Module_Library_DB" name="l.success" value="ProductImage_Load_Type( l.loaded_variants[1]:id, l.imagetype:main:id, l.loaded_type )" />
						<mvt:do file="g.Module_Library_DB" name="l.image_loaded_success" value="Image_Load_ID( l.loaded_type:image_id, l.image )" />
						<mvt:if expr="l.image_loaded_success EQ 1">

							<mvt:if expr="(l.image:height LT l.height)">
								<mvt:assign name="l.height" value="l.image:height" />
							</mvt:if>
							<mvt:if expr="(l.image:width LT l.width)">
								<mvt:assign name="l.width" value="l.image:width" />
							</mvt:if>
				
							<mvt:do file="g.Module_Library_DB" name="l.success" value="GeneratedImage_FindOrInsert_Image_Dimensions( l.image, l.width, l.height, l.generated_image )" />
							<mvt:if expr="l.generated_image">

								<mvt:assign name="l.settings:option:image" value="l.generated_image:image" />
								<mvt:do file="g.Module_Library_DB" name="l.success" value="Option_Update( l.settings:option )" />
				
							</mvt:if>
				
						</mvt:if>
					
						<mvt:foreachstop />
					</mvt:if>

				</mvt:foreach>

			<mvt:comment></mvt:if></mvt:comment>
		</mvt:foreach>
	</mvt:if>
</mvt:foreach>

以上是关于html Miva - 生成选项图像的主要内容,如果未能解决你的问题,请参考以下文章

html Miva - 批量报告 - 饲料生成器

xml Miva - mvt:按图像类型代码加载图像

xml Miva - 使用产品主图像的CTGY子类别图像

xml Miva - 使用mvt:do生成RMA

html miva_array_search.html

html miva_array_search.html