xml Miva - 负载价格AJAX呼叫

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml Miva - 负载价格AJAX呼叫相关的知识,希望对你有一定的参考价值。

<mvt:if expr="g.get EQ 'prices'">
	<mvt:comment><!-- g.Product_Codes is a comma separated list of product codes being sent --></mvt:comment>
	<mvt:assign name="l.settings:product_codes" value="miva_array_deserialize(g.Product_Codes)" />
	<mvt:foreach iterator="code" array="product_codes">
		<mvt:do name="l.result" file="g.Module_Library_DB" value="Product_Load_Code( l.settings:code, l.settings:product )" />
		<mvt:do file="g.Module_Feature_TUI_UT" name="l.result" value="CommonComponentFields_Initialize_Product_Runtime( l.settings:product )" />
		<mvt:assign name="l.index" value="miva_array_insert( l.settings:products, l.settings:product, -1 )" />
	</mvt:foreach>

	<mvt:do file="g.Module_Feature_TUI_UT" name="l.result"  value="CommonComponentFields_Initialize_Product_Discounts_Runtime(l.settings:products, miva_array_elements(l.settings:products) )" />

	{
	 <mvt:foreach iterator="product" array="products">
		<mvt:if expr="POS1 GT 1">,</mvt:if>
		"&mvtj:product:code;": {
			"price": "&mvt:product:price;",
			"formatted_price": "&mvt:product:formatted_price;",
			"base_price": "&mvt:product:base_price;",
			"formatted_base_price": "&mvt:product:formatted_base_price;",
			"retail": "&mvt:product:retail;",
			"formatted_retail": "&mvt:product:formatted_retail;",
			"cost": "&mvt:product:cost;",
			"formatted_cost": "&mvt:product:formatted_cost;"
		}
	</mvt:foreach>
	}
<mvt:else>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>&mvt:store:name; API</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css">
	</head>
	<body>
		<div class="container">
			<div class="row">
				<div class="col-sm-6 col-sm-offset-3">
					<h1>API</h1>
					<hr>
					<mvt:if expr="g.get EQ 'category'">
						<h2>Category</h2>
						<mvt:if expr="g.ID">
							<h3>ID</h3>
							<mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_ID( g.ID, l.settings:category )" />
							<mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:category), ',', '<br>'))" />
						<mvt:elseif expr="g.Code">
							<h3>Code</h3>
							<mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( g.Code, l.settings:category )" />
							<mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:category), ',', '<br>'))" />
						</mvt:if>
					<mvt:elseif expr="g.get EQ 'product'">
						<h2>Product</h2>
						<mvt:if expr="g.ID">
							<h3>ID</h3>
							<mvt:do name="l.result" file="g.Module_Library_DB" value="Product_Load_ID( g.ID, l.settings:product )" />
							<mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:product), ',', '<br>'))" />
						<mvt:elseif expr="g.Code">
							<h3>Code</h3>
							<mvt:do name="l.result" file="g.Module_Library_DB" value="Product_Load_Code( g.Code, l.settings:product )" />
							<mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:product), ',', '<br>'))" />
						</mvt:if>
					</mvt:if>
				</div>
			</div>
		</div>
	</body>
</html>
</mvt:if>

以上是关于xml Miva - 负载价格AJAX呼叫的主要内容,如果未能解决你的问题,请参考以下文章

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

xml Miva - 检查客户是否在批发价格组中

xml Miva - 模板饲料 - variant_id,促销价和变种价格

html Miva - 以最低价格对多维数组排序运输方式

html Miva客户注册负载

xml Miva - 产品批量定价供应XML