xml URL重写 - 网站强制转https

https
<rewrite>
		<rule name="網站強制轉 https" stopProcessing="true">
			<match url="(.*)" />
			<conditions>
				<add input="{URL}" pattern="\.asmx$" negate="true" />
				<add input="{URL}" pattern="green-life\/file\/" negate="true" />
				<add input="{URL}" pattern="downtime\.aspx*" negate="true" />
				<add input="{URL}" pattern="backstageonehour\.aspx*" negate="true" />
				<add input="{URL}" pattern="backstage\.aspx*" negate="true" />
				<add input="{HTTPS}" pattern="^OFF$" />								
			</conditions>
			<action type="Redirect" url="https://{HTTP_HOST}/google.com/{R:1}" redirectType="Permanent" />
		</rule>
	</rules>
</rewrite>

xml URL重写 - 网站强制导向另一网页

Redirect
<rewrite>
	<rules>
		<rule name="網站強制導向另一網頁" stopProcessing="true">
			<match url="(.*)" />
			<conditions>
				<add input="{REQUEST_URI}" pattern="^(/[a-zA-Z0-9]+/(.*))" />
			</conditions>
			<action type="Redirect" url="https://www.google.com.tw/" />
		</rule>
	</rules>
</rewrite>

xml 手动电子邮件触发器

Manual_Email_Trigger.mvt
<mvt:if expr="l.settings:order:total GT '100'">
	<mvt:comment>Defin l.run</mvt:comment>
	<mvt:do file="g.Module_Feature_CUS_DB" name="l.success" value="Customer_Load_Login( g.Customer_Login, l.run:customer )" />

	<mvt:comment>Load email</mvt:comment>
	<mvt:do file="g.Module_Root $ '/modules/fulfill/templateorderemails.mvc'" name="l.success" value="TemplateOrderEmail_Load_Code( 'ACTIVE_CF', l.email_active )" />
	
	<mvt:comment>Send Email</mvt:comment>
	<mvt:do file="g.Module_Root $ '/modules/fulfill/templateorderemails.mvc'" name="l.TemplateOrderEmails_SendEmail" value="TemplateOrderEmails_SendEmail( l.run, l.email_active )" />
</mvt:if>

xml 订购自定义字段

Order_Custom_Fields.mvt
<!-- Add within form on OCST Template -->
<label for="order_notes">Order Notes:</label>
<textarea id="order_notes" name="order_notes"></textarea>

<!-- Add on OSEL Template -->
<mvt:item name="customfields" param="Write_Basket( 'order_notes', g.order_notes )" />
<!-- Create a custom field with the type or order and the code of order_notes -->

xml 自定义字段调试

Custom_Field_Debug.mvt
<mvt:item name="customfields" param="Read_Product_Code('test','msrp', g.msrp)" />
<mvt:item name="customfields" param="Debug()" />
<mvt:if expr="s.remote_addr EQ '111.111.111.11' ">
	<mvt:item name="customfields" param="Debug()" />
</mvt:if>

xml 自定义篮子场快捷方式

Custom_Basket_Field_Shortcut.mvt
<mvt:item name="customfields" param="Write_Basket( 'my_made_up_code', 'This is my value I am going to write to the basket' )" />
<mvt:item name="customfields" param="Write_Basket( 'color', 'red' )" />
<mvt:item name="customfields" param="Read_Basket( '' )" />
<mvt:foreach iterator="basket" array="customfields">
     &mvte:basket:code; - &mvte:basket:value;<br/>
</mvt:foreach>

xml 篮子自定义字段语法

Basket_Custom_Field_Syntax.mvt
<!--Reads a custom field from the sNN_BasketInfo table-->
<mvt:item name="customfields" param="Read_Basket( 'custom_field_code', l.settings:customfields )" />
<!--Writes a custom field to the sNN_BasksetInfo table-->
<mvt:item name="customfields" param="Write_Basket( 'custom_field_code', 'value' )" />

xml 篮子自定义领域

Basket_Custom_Field.mvt
<!--Reads a custom field from the sNN_BasketInfo table-->
<mvt:item name="customfields" param="Read_Basket()" />
<!--Writes a custom field to the sNN_BasksetInfo table-->
<mvt:item name="customfields" param="Write_Basket()" />

xml 功能示例

Function_Example.mvt
<mvt:item name="customfields" param="Write_Product_ID( l.settings:product:id, 'short_name', 'This is short_name Custom Field' )" />
<mvt:item name="customfields" param="Read_Product_ID( l.settings:product:id, 'short_name', l.settings:product:customfield:short_name )" />
<mvt:if expr="NOT ISNULL l.settings:product:customfield:short_name">
	<h1>&mvte:product:customfield:short_name;</h1>
</mvt:if>

Output:
<h1>This is short_name Custom Field</h1>

xml 读写功能

Read_Write_Function.mvt
<!-- Read Customfields -->
<!-- Category -->
<mvt:item name="customfields" param="Read_Category_Code( 'category_code', 'custom_field_code', l.settings:customfields )" />
<mvt:item name="customfields" param="Read_Category_ID( 1, 'custom_field_code', l.settings:customfields )" />
<!-- Product -->
<mvt:item name="customfields" param="Read_Product_Code( 'product_code', 'custom_field_code', l.settings:customfields )" />
<mvt:item name="customfields" param="Read_Product_ID( 1, 'custom_field_code', l.settings:customfields )" />
<!-- Customer -->
<mvt:item name="customfields" param="Read_Customer_Login( 'test@test.com', 'custom_field_code', l.settings:customfields )" />
<mvt:item name="customfields" param="Read_Customer_ID( 666, 'custom_field_code', l.settings:customfields )" />
<!-- Write Customfields -->
<!-- Category -->
<mvt:item name="customfields" param="Write_Category_Code( 'category_code', 'custom_field_code', 'value' )" />
<mvt:item name="customfields" param="Write_Category_ID( 1, 'custom_field_code', 'value' )" />
<!-- Product -->
<mvt:item name="customfields" param="Write_Product_Code( 'product_code', 'custom_field_code', 'value' )" />
<mvt:item name="customfields" param="Write_Product_ID( 1, 'custom_field_code', 'value' )" />
<!-- Customer -->
<mvt:item name="customfields" param="Write_Customer_Login( 'test@test.com', 'custom_field_code', 'value' )" />
<mvt:item name="customfields" param="Write_Customer_ID( 666, 'custom_field_code', 'value' )" />