html Miva - 获取刚刚添加到购物车的商品

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html Miva - 获取刚刚添加到购物车的商品相关的知识,希望对你有一定的参考价值。

<mvt:if expr="g.Action EQ 'ADPR'">
	<mvt:foreach iterator="item" array="basket:groups">
		<mvt:assign name="l.settings:item:was_just_added" value="1" />
		<mvt:if expr="l.settings:item:code NE g.Product_Code">
			<mvt:assign name="l.settings:item:was_just_added" value="0" />
			<mvt:foreachcontinue/>
		</mvt:if>
		<mvt:if expr="miva_array_elements(g.Product_Attributes)">
			<mvt:assign name="l.settings:item:option_counter" value="0" />
			<mvt:foreach iterator="option" array="item:options">
				<mvt:assign name="l.settings:item:option_counter" value="l.settings:item:option_counter + 1" />
				<mvt:if expr="l.settings:option:attr_code NE g.Product_Attributes[l.settings:item:option_counter]:code">
					<mvt:assign name="l.settings:item:was_just_added" value="0" />
					<mvt:foreachcontinue/>
				</mvt:if>
				<mvt:if expr="l.settings:option:option_id">
					<mvt:if expr="l.settings:option:opt_code NE g.Product_Attributes[l.settings:item:option_counter]:value">
						<mvt:assign name="l.settings:item:was_just_added" value="0" />
						<mvt:foreachcontinue/>
					</mvt:if>
				<mvt:elseif expr="NOT ISNULL l.settings:option:data">
					<mvt:if expr="l.settings:option:data NE g.Product_Attributes[l.settings:item:option_counter]:value">
						<mvt:assign name="l.settings:item:was_just_added" value="0" />
						<mvt:foreachcontinue/>
					</mvt:if>
				<mvt:elseif expr="NOT ISNULL l.settings:option:data_long">
					<mvt:if expr="l.settings:option:data_long NE g.Product_Attributes[l.settings:item:option_counter]:value">
						<mvt:assign name="l.settings:item:was_just_added" value="0" />
						<mvt:foreachcontinue/>
					</mvt:if>
				</mvt:if>
			</mvt:foreach>
		</mvt:if>
		<mvt:if expr="l.settings:item:was_just_added">
			<mvt:assign name="l.settings:basket:just_added" value="l.settings:item" />
		</mvt:if>
	</mvt:foreach>
	<h3>Just Added:</h3>
	<mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:basket:just_added), ',', '<br>'))" />
</mvt:if>

以上是关于html Miva - 获取刚刚添加到购物车的商品的主要内容,如果未能解决你的问题,请参考以下文章

html Miva - 删除BOT Traffic的购物车

html Miva - Google购物Feed - v2

html Miva - 以mvt:do为顾客购物

html Miva - 使用购物篮自定义字段预览功能

html Miva - 继续购物链接 - 使用Toolkit和Toolbelt

html Miva - Base ReadyTheme - BASK:购物篮内容