11/28/2016 - 11:52 PM

Variant Basket Item In Template Code

Variant Basket Item In Template Code

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

	<mvt:comment>Load Variant Parts For Basket Item</mvt:comment>
	<mvt:do file="g.Module_Library_DB" name="l.part_count" value="ProductList_Load_Variant(l.settings:item:product_id, l.settings:item:variant_id, l.settings:parts)" />

	<mvt:comment>Only run the folloing if the varaints parts is 1</mvt:comment>
	<mvt:if expr="l.part_count EQ 1">

		<mvt:comment>Always use the first variant part (ignores kits)</mvt:comment>
		<mvt:assign name="l.part" value="l.settings:parts[1]" />

		<mvt:comment>Load Module Config & Assign Variant SKU</mvt:comment>
		<mvt:do file="'/mm5/5.00/modules/log/variantbasketitem.mvc'" name="l.success" value="VariantBasketItem_Load( l.config )" />

			<mvt:if expr = "l.config:field EQ 'code'">
				<mvt:assign name = "l.settings:item:code"	value = "l.part:code" />
			<mvt:elseif expr = "( l.config:field EQ 'sku' ) AND ( NOT ISNULL l.part:sku )">
				<mvt:assign name = "l.setting:item:code"	VALUE = "l.part:sku" />

		<mvt:comment>Update Basket Table</mvt:comment>
		<mvt:do file="'/mm5/5.00/modules/log/variantbasketitem.mvc'" name="l.success" value="VariantBasketItem_BasketItem_Update_Code( l.item )" />