xml Miva - 订购商品:主码的变体代码

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml Miva - 订购商品:主码的变体代码相关的知识,希望对你有一定的参考价值。

<mvt:foreach iterator="item" array="order:items">

	<mvt:comment>
		<!--
			Variant Basket Item Replacement Helper
		-->
	</mvt:comment>
	<mvt:comment><!-- Determine of product is a variant or not --></mvt:comment>
		<mvt:if expr="l.settings:item:product:id GT 0 AND l.settings:item:product:id NE l.settings:item:product_id">
			<mvt:assign name="l.settings:item:is_variant" value="1" />
			<mvt:assign name="l.settings:item:true:master:id" value="l.settings:item:product_id" />
			<mvt:assign name="l.settings:item:true:variant:id" value="l.settings:item:product:id" />
			<mvt:assign name="l.settings:item:true:lookup:id" value="l.settings:item:true:variant:id" />
		<mvt:else>
			<mvt:assign name="l.settings:item:is_variant" value="0" />
			<mvt:assign name="l.settings:item:true:master:id" value="l.settings:item:product_id" />
			<mvt:assign name="l.settings:item:true:variant:id" value="0" />
			<mvt:assign name="l.settings:item:true:lookup:id" value="l.settings:item:true:master:id" />
		</mvt:if>
	<mvt:comment><!-- Lookup & Standardize master product code --></mvt:comment>
		<mvt:if expr="l.settings:item:true:lookup:id">
			<mvt:assign name="g.sql_select" value="'SELECT id,code FROM ' $ g.store_table_prefix $ 'Products WHERE id = ' $ l.settings:item:true:lookup:id $ ' LIMIT 1'" />
			<mvt:item name="ry_toolbelt" param="query|g.sql_select|item:true:lookup:results" />
			<mvt:assign name="l.settings:item:standard:id" value="l.settings:item:true:lookup:results[1]:id" />
			<mvt:assign name="l.settings:item:standard:code" value="l.settings:item:true:lookup:results[1]:code" />
		</mvt:if>

	&mvt:item:standard:code;

</mvt:foreach

以上是关于xml Miva - 订购商品:主码的变体代码的主要内容,如果未能解决你的问题,请参考以下文章

sql Miva - 变体产品代码的主产品

sql Miva - 主产品代码中的所有变体

html Miva产品最后订购日期

商品订购及货物采购信息系统(代码分析)

xml Miva - 动态唯一字母数字代码

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