xml Miva - 变异篮子项目替换与修复的Skipped产品

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml Miva - 变异篮子项目替换与修复的Skipped产品相关的知识,希望对你有一定的参考价值。

<mvt:comment>
	| ------------------------------------------------
	| Variant Basket Item Replacement (VBIR) with fix for Skipped Replacements
	| ------------------------------------------------
	| This custom functionality replicates the VBIR module,
	| The main difference is that the standard VBIR module ties into the ADPR, ADPM, actions and sometimes products item don't get updated.
	| This code will always ensure that the basket item codes are updated.
</mvt:comment>

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

	<mvt:comment>
		| We only need to do this process for items with a single variant part
	</mvt:comment>
	<mvt:if expr="miva_array_elements( l.settings:item:parts ) NE 1 ">
		<mvt:foreachcontinue/>
	</mvt:if>

	<mvt:comment>
		| Update the DB with our custom variant code logic
	</mvt:comment>
	<mvt:if expr="l.settings:item:parts[1]:code NE l.settings:item:code">
		<mvt:assign name="l.settings:query:query" value="'UPDATE ' $ g.Store_Table_Prefix $ 'BasketItems SET code = ? WHERE line_id = ?'" />
		<mvt:assign name="l.settings:query:bind_parameters[1]" value="l.settings:item:parts[1]:code" />
		<mvt:assign name="l.settings:query:bind_parameters[2]" value="l.settings:item:line_id" />
		<mvt:item name="sql" param="l.settings:query"/>

		<mvt:comment>
			| Update the current page's `l.settings:basket:items[]:code` and `l.settings:basket:groups[]:code` values for the current element
		</mvt:comment>
		<mvt:assign name="l.settings:item:code" value="l.settings:item:parts[1]:code" />
		<mvt:assign name="l.result" value="miva_array_search( l.settings:basket:groups, POS1, l.group, 'l.settings:item:code EQ l.group:code' )" />
		<mvt:assign name="l.group:code" value="l.settings:item:parts[1]:code" />
	</mvt:if>


</mvt:foreach>

以上是关于xml Miva - 变异篮子项目替换与修复的Skipped产品的主要内容,如果未能解决你的问题,请参考以下文章

xml Miva - 变异篮子项目替换多变量部分

xml Miva - 添加和删除篮子费用

xml Miva - 在订单确认电子邮件中修复丢失的购物篮/订单自定义字段

xml Miva - Smart-Breadcrumbs s.http_referer调整全局预渲染

xml Miva - 价格组查询与mvt:做

xml 使用WordPress进行内容管理与Miva静态页面。