html Miva Variant自定义字段和库存

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html Miva Variant自定义字段和库存相关的知识,希望对你有一定的参考价值。

MivaEvents.SubscribeToEvent('variant_changed', function (product_data) {
	$.ajax({
		url: '/APVCF.html',
		type: 'POST',
		data: product_data
	})
	.done(function(variant_data) {
		console.log(variant_data);
	});
});
<mvt:comment><!-- http://www.example.com/APVCF.html?Product_Code=mstr-509-HEL-CM2&Variant_ID=17628 --></mvt:comment>
<mvt:comment><!-- <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:item), ',', '<br>'))" /> --></mvt:comment>

<mvt:comment>Creates the functions and variables needed to access variant product information and custom product fields.</mvt:comment>
<mvt:item name="ry_toolbelt" param="do|g.module_library_db|g.result1|Runtime_Product_Load_Code( g.Product_Code, l.all_settings:master_product )" />
<mvt:item name="ry_toolbelt" param="do|g.module_library_db|g.result2|ProductList_Load_Variant( l.all_settings:master_product:id, g.Variant_ID, l.all_settings:part_products )" />
<mvt:comment><!-- l.settings:part_products[1]:inv_available --></mvt:comment>
<mvt:item name="ry_toolbelt" param="custom_products|l.all_settings:customfields|l.all_settings:part_products[1]:id" />

<mvt:comment>Pull the "preOrder" custom product field value from variant product, encode the value and then format the value to jQuery JSON format.</mvt:comment>
<mvt:item name="ry_toolbelt" param="do|g.module_json|g.temp|JSON_Encode( l.all_settings:customfields:value:preOrder )" />
<mvt:item name="ry_toolbelt" param="assign|l.all_settings:customfields:value_encoded:preOrder|glosub( g.temp, '\x', '\u00' )" />

{"preOrder": "&mvt:customfields:value_encoded:preOrder;"}
<mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:item), ',', '<br>'))" />

以上是关于html Miva Variant自定义字段和库存的主要内容,如果未能解决你的问题,请参考以下文章

html Miva - 404 Not Found Page(NTFD):自定义字段重定向

xml Miva - 从组中加载所有自定义字段

xml Miva - 在URI模板中加载自定义字段

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

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

xml 在Miva Feed中获取variant_id