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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml Miva - 使用产品主图像的CTGY子类别图像相关的知识,希望对你有一定的参考价值。

<mvt:foreach array="cattree_categories" iterator="cattree_category">
	<mvt:if expr="l.settings:cattree_category:parent_id EQ l.settings:category:id">
		<mvt:assign name="l.null" value="miva_array_insert(l.settings:subcats, l.settings:cattree_category, -1)" />
	</mvt:if>
</mvt:foreach>

<mvt:assign name="l.settings:subcat_count" value="miva_array_elements(l.settings:subcats)" />
<mvt:if expr="l.settings:subcats GT 0">
	<div class="row bg-white main-content-row sub-category-layout">
		<mvt:foreach iterator="sub_category" array="subcats">
			<mvt:comment><!-- Load First Product From Sub Category & It's resized Main image --></mvt:comment>
				<mvt:if expr="ISNULL l.settings:sub_category:image">
					<mvt:do file="g.Module_Library_DB" name="l.result" value="Runtime_ProductList_Load_Offset_Category( l.settings:sub_category:id, 0, 1, l.settings:sub_category:sub_products:next_offset, l.settings:sub_category:sub_products:list )" />
					<mvt:assign name="l.settings:sub_category:product" value="l.settings:sub_category:sub_products:list[1]" />
					<mvt:do file="g.Module_Library_DB" name="l.settings:sub_category:product:image_count" value="ProductImageDataList_Load_Product(l.settings:sub_category:product:id, l.settings:sub_category:product:images)" />
					<mvt:foreach iterator="image" array="sub_category:product:images">
						<mvt:if expr="l.settings:image:imagetype:code EQ 'main'">
							<mvt:assign name="l.settings:sub_category:product:main_image" value="l.settings:image" />
							<mvt:foreachstop/>
						</mvt:if>
					</mvt:foreach>
					<mvt:if expr="l.settings:sub_category:product:main_image:image:id">
						<mvt:do file="g.Module_Library_DB" name="l.result" value="GeneratedImage_FindOrInsert_Image_Dimensions( l.settings:sub_category:product:main_image:image, '300', '200', l.settings:sub_category:product:main_image:generated )" />
					</mvt:if>
					<mvt:if expr="l.settings:sub_category:product:main_image:generated:id">
						<mvt:assign name="l.settings:sub_category:image" value="l.settings:sub_category:product:main_image:generated:image" />
					<mvt:elseif expr="l.settings:sub_category:product:main_image:image:id">
						<mvt:assign name="l.settings:sub_category:image" value="l.settings:sub_category:product:main_image:image:image" />
					</mvt:if>
				</mvt:if>

			<div class="column half medium-one-third sub-category uppercase">
				<a href="&mvt:sub_category:link;" title="&mvt:sub_category:name;">
					<mvt:if expr="l.settings:sub_category:image">
						<img src="&mvt:sub_category:image;" alt="&mvt:sub_category:name;" title="&mvt:sub_category:name;" />
					</mvt:if>
					&mvt:sub_category:name;
				</a>
			</div>
		</mvt:foreach>
	</div><!-- end sub-category listings -->
</mvt:if>

以上是关于xml Miva - 使用产品主图像的CTGY子类别图像的主要内容,如果未能解决你的问题,请参考以下文章

xml Miva - 最近浏览过的产品

xml 基于面包屑的Miva相关产品

xml Miva QA:散装产品

xml Miva - 在商店中加载所有产品

xml Miva - 货件领料报告|总产品收入报告|汇总产品信息

sql Miva Merchant - 选择特定产品和图像类型的所有生成图像