Product Configurations
This evolving document will explain the basics of our XML product configuration language. This XML "language" is used for defining every aspect of a product's delivery, pricing, and custom fields (including validation).
If you're familiar with HTML, then you'll find that several common themes such as "tags" are present in both HTML and XML.
本文件将介绍我们XML产品配置的语言基础。这个XML“语言”是用来定义一个产品的交付、定价和自定义字段(包括验证)等各个方面的内容。如果您熟悉HTML的话,您会发现它们的几个共有代码,如"tags"在HTML和XML都有出现。
Contents
内容
Overview
总览
Technically, product configurations are independent of any one product. This means that you could potentially have one product configuration which describes multiple products. If you have many products which are setup in an identical manner, this makes maintenance of the products very convenient. By keeping the configuration separate from the product itself, this also enables you to work on a new configuration before assigning it to an existing product.
技术上,产品设置与任何产品本身是各自独立的,也就是说您可以用一个产品配置来设定多个产品。如果您有很多产品都是以同样方式进行设置,那么产品的维护就会很方便。保持产品配置与产品本身分离,让您可以先进行新的配置操作,再指定配置所应用的产品。
We believe it's best to start with a short example before describing some of the concepts within the example. There's no
need to try and understand this example right now, but at least you'll be able to see what makes up an entire configuration end-to-end.
Using this example a customer would see a drop down box with two license options, each with a different price. Selecting either
option would determine the price for the order. After the order completes, the customer would receive a license code pulled from a
list with id "1234" and would also be sent a custom email named "My Custom Email".
在解释示例中的某些概念之前,我们最好还是从简单示例开始。目前,您不必努力去了解这个示例,但您至少能够看到整个配置从头到尾的组成部分。客户在这个例子中可以看到在下拉选框中有两个许可证选项,每个选项的价格不同,所选择的选项将决定订单的价格。订单完成后,客户将收到清单中ID为"1234"的许可代码和一个名为"My Custom Email"的自定义邮件。
<product-configuration>
<fields>
<section>
<group>
<display>Order Type</display>
<contents>
<select type="menu" field="ordertype" display="Order Type" pricing="order">
<option value="Standard License" price="24.95"/>
<option value="Site License" price="199.95"/>
</select>
</contents>
</group>
</section>
</fields>
<delivery>
<deliver-standard-list id="1234"/>
<deliver-email id="My Custom Email"/>
</delivery>
</product-configuration>
Concepts
概念
Product configurations consist of only a few broad, but important, concepts. After briefly describing each concept
we'll go over each in more depth by referencing the example given above.
产品配置包含几个不多但重要的广义概念。简要介绍各个概念之后,我们将参照上述例子对这些概念进行深入解剖。
-
Fields
字段
Fields refer to how the product detail page appears to the customer.
By default, this would simply be a quantity box, and the product's price. But suppose you want to go beyond this. For example, your product may come in two different license types, a "Standard License" and a "Site License". You'd want the customer to be able to choose between the two license types via a drop down box and also charge them a different amount for each. Or, perhaps you need to have cutomers enter a "serial number" when ordering, or even ask the customer where they heard about your product. All of these examples describe ways in which the product detail page appears to the customer.
字段是指向客户显示的产品详情页面的样式,默认为产品数量选框和产品价格。如果您不想局限于此,例如您的产品可以有两个不同的许可证类型,分别是“标准许可”和“公司许可”,或您需要为客户提供二选一的下拉选框,针对不同的选项收取不同的金额。或者,您可能需要让客户在订购时输入“序列号”,乃至询问客户获知产品的渠道。所有这些示例都是用来描述客户所看到的产品详情页面的样式。
-
Delivery
交付
Delivery refers to how the customer will receive your product after ordering. There are a number of immediate, electronic delivery methods available including downloads, licenses (fixed, list based, algorithm based, etc), and custom emails.
交付是指客户在订购后如何接收您的产品。目前提供很多立即的电子交付方式,包括下载、许可证(固定、注册码表、算法程序、等等)和自定义邮件。
-
Pricing
定价
If your product's pricing is more complex than a simple, fixed value such as 24.95, then this complex pricing must be defined in the product configuration. Pricing may be defined in a number of different ways, but the most common way is to associate a certain price with a custom field that you have defined. For example, in the scenario described above with two license types in a drop down box, you could assign a certain price to each option in the drop down box. The "Standard License" might be 24.95, while the "Site License" might be 199.95. The system automatically takes care of displaying the price for you in the current currency. Another type of pricing which is common is "quantity based pricing" or "tiered pricing", where the customer receives a less expensive unit cost depending on the number of units they order.
如果您的产品定价不是单个固定值如24.95那么简单,那么这种复杂定价方式必须在产品配置中定义。定义定价的方式有很多不同的方法,但最常用的方法是对您所定义的某个自定义字段指定一个价格。例如,在上述的提供两个许可类型的下拉选框的情况。“标准许可”价格可能为24.95,而“公司许可”可能是199.95。系统自动为您显示当前货币的价格。另外一种常见的定价是“基于数量的定价”或“分层级定价”,客户可以依据他们所订购的产品数量而获得较为便宜的单位价格。
Important Note: Complex pricing defined in a product configuration is added to the fixed price set within your product.
Therefore, to use only the pricing within the product configuration (the majority of cases) you must set your product's price to zero "0".
重要提示:产品配置中定义的复杂定价已添加到您产品中所设置的固定价格,因此,为了只使用产品配置中的定价(大部分情况下),您必须把您的产品价格设为“0”。
-
Scripts
脚本程序
"Scripts" are not normally used in the majority of configurations, but they provide much needed functionality when
handling unusual scenarios. Scripts are like a "mini" programming language written in XML, with conditional "if" statements, while loops, variables, and even functions.
Scripts are most useful when producing license codes, connecting to a remote server, or handling complex field validation.
Although verbose, scripts are an important part of the product configuration functionality.
通常多数的配置不使用“脚本程序”,但在解决特殊情况时,他们能发挥必要作用。脚本就像一套“袖珍型”的以XML编写的程序设计语言,它有条件"if"语句、while循环、变量、甚至函数。脚本在生成许可代码、连接远程服务器或解决复杂字段验证方面非常有用。虽然这些脚本程序较为冗长,但脚本程序在产品配置功能方面担当重要角色。
In Depth - Fields
深入—字段
-
Groups <group>
组<group>
A product configuration's display consists of "groups" of related fields and information.
Groups consist of a display such as "Order Type" or "Serial Number", and their contents such as a drop down box or text box.
While a group may contain multiple fields, it's generally more useful to split multiple fields into other groups.
In the example above, we have used just
one group, "Order Type", to display a drop down box to the customer allowing them to select their license type.
产品配置的显示内容是由相关字段和信息的"groups"所构成。组是由一个显示内容如"Order Type"或"Serial Number"和它们的内容选项如下拉框或文本框这样的内容组成。虽然一个组可以包含多个字段,但通常把几个字段划分到其他的几个组能更利于操作。以上例子中,我们仅使用了一个组"Order Type"来显示一个下拉选框供客户选择许可类型。
-
Validation <validation>
验证<validation>
Field validation is useful when you need to be concerned with exactly what a customer is entering into a custom field you've defined. For example, perhaps you've created a custom "serial number" field and you need to ensure that the customer only enters exactly six numbers.
Field validation allows you to ensure that this occurs, and that the user is aware that they need to correct the field should it be invalid.
The example above does not require any validation however we've provided other examples which do use field validation.
当您需要限定客户在您定义的自定义字段中所输入的内容时,字段验证是非常有用的。例如,您可能已经建立了自定义的“序列号”字段,需要确认客户在此字段输入刚好6个数字,那么字段验证可为您确保这一点。如果用户在此框的输入信息无效时,他们将会获得纠正提示。上述示例并未要求验证,但我们提供了其他使用字段验证的例子。
-
Field Types
字段类型
Fields types, except hidden fields, are used within the "contents" of a group. All field types have at least two
required attributes "field" and "display". The "field" attribute gives a name to the field as it will be referenced
in other locations in the product configuration. The "display" attribute is not how the field will display to the
customer, but how the field will be displayed to you in the online reporting.
除了隐藏字段,所有其他的字段类型都在组的"contents"中使用。所有的字段类型至少有两个必需属性信息"field"和"display"。"field"属性为字段赋予名称,以供它将在产品配置的其他操作中被引用。"display"属性不是向客户如何显示的样式,但是该字段将如何在您的网上报告中显示的名称。
- Select
<select>
选择<select>
A selection field is useful when you require that a customer select from a series of predefined field values.
Selections may be done using a drop down box, radio buttons, or checkboxes.
如果您要求客户从一系列预先定义的字段值中进行选择,那么选择字段十分有用。选择字段可通过使用下拉选框、单选按钮或复选框来实现。
- Textbox <textbox>
文本框<textbox>
A textbox field allows a customer to enter a single line of freeform text. This text is captured on the product
detail page and stored in the database.
文本框字段能够让客户输入单行的任意文本。 此文本显示在产品详情页面上并存储在数据库中。
- Tiered/Quantity Pricing <quantity-pricing>
分层/基于数量定价<quantity-pricing>
Tiered or quantity based pricing allows you to setup a sliding scale of unit cost to quantity. For example:
分层或基于数量定价能为您设置随着数量按比例增减的单位价格。例如:
1 License - 24.95
1个许可证—24.95
2-10 Licenses - 18.95
2至10个许可证—18.95
10+ Licenses - 14.95
10个以上许可证—14.95
- Hidden <hidden>
隐藏<hidden>
Hidden fields are used when you need to persist a value in the database beyond the order process, but do not
need the customer to view the field, or enter any data into the field.
如果您需要在非订购过程保持数据库中的某个值,但不需客户看到该字段或在该字段输入任何数据,这时使用隐藏字段。
In Depth - Delivery深入—交付
There are several different delivery methods to choose from, though some are simply "macros" for the root delivery types.
The root delivery types are "License", "Product Download", "Custom Email", "Background", "Custom Display", and "Package".
Each of the delivery methods used in a product configuration will end up creating one of these root types.
Delivery methods may either be specified to occur for all orders of a product (the base delivery methods), and delivery methods
may also be specified to execute only if chosen in a selection field "<select>".
现有好几种不同的交付方式供选择,虽然其中有些交付方式只是由基本交付类型交互组合而成。基本的交付类型为"License"、 "Product Download"、 "Custom Email"、"Background"、"Custom Display"和 "Package"。产品配置中所使用的每一个交付方式最终将建立其中一个交付类型。交付方式可以指定应用在某个产品的所有订单上(基本交付方式),或在选择字段"<select>"所选的范围被选择应用。
Although you may override the delivery text on the receipt using a "<deliver-custom>", this is not recommended
as you then loose out on the delivery text being multi-lingual. All predefined delivery texts are aware of
many different languages.
尽管您可以使用"<deliver-custom>"来改写收据上的交付文本,但我们不推荐您这样做,因为您会因此失去交付文本的多语种支持。所有预先定义的交付文本都有多种不同的语言版本。
- License Delivery <deliver-license>
许可证交付<deliver-license>
Uses a "script" to produce a license code in a non-standard, user defined way.
利用“脚本程序”以用户定义的非标准方式生成许可码。
- License Delivery - Standard Algorithm <deliver-standard-algorithm>
许可证交付—标准算法<deliver-standard-algorithm>
Delivers a license using a predefined algorithm, passing only the recipient's name as the first parameter.
使用预先定义的算法生成许可证交付,其中仅把收件人的名称传值为第一个参数。
- License Delivery - Standard List <deliver-standard-list>
许可证交付—标准注册码表<deliver-standard-list>
Delivers a license using a predefined list of codes.
使用从预先定义的注册码表中取得的许可证交付。
- License Delivery - Fixed Code <deliver-fixed-license>
许可证交付—固定代码<deliver-fixed-license>
Delivers an identical/fixed license code for every order.
每个订单都交付同样/固定的许可证码。
- Product Download Delivery <deliver-standard-download>
产品下载交付<deliver-standard-download>
Delivers a URL where the customer may download the file assigned to the product ordered.
交付一个供客户下载订购产品文件的URL。
- Custom Email Delivery <deliver-email>
自定义邮件交付<deliver-email>
Delivers a custom email to the customer, separate from the receipt. This is useful for displaying
a great deal of information, for example how to register the product, that is not suitable for display on the receipt.
向客户发送一个与收据无关的自定义邮件。如果您需要向客户提供大量但不宜出现在收据上的信息,例如如何注册产品时,这是十分有用的。
- Background Delivery <deliver-background>
后台交付<deliver-background>
Background delivery is primarily useful for hitting a remote CGI with the recipient and/or license information generated. 后台交付在需要将收件人和/或生成的许可证信息投送到远程CGI时是最有用的。
Note: Delivery methods are not guaranteed to execute in any particular order -- one delivery method can't
depend on another's information. The exceptions to this are
custom emails "<deliver-email>", background delivery "<deliver-background>", and the display of "<deliver-custom>".
These are guaranteed to run after all other delivery methods have executed. Generally this behavior is a non-issue for most setups.
注:交付方式在任何特定的定单中的执行顺序不是一定的——所以交付方式不能依赖另一交付方式的信息。例外的是自定义邮件"<deliver-email>"、后台交付"<deliver-background>"和"<deliver-custom>"的显示,它们会在所有其他交付方式执行后才运行。多数设置通常可以忽略这问题。
Getting Started
如何开始
- Create a new XML file using the XML File Manager.
- Choose "Product Configuration" as the XML file type to create.
创立的XML文件类型选为"Product Configuration"。
- Add custom fields, pricing, and delivery to the new configuration (see the examples section for more ideas).
为新的配置添加自定义字段、定价和交付(关于更多的添加项,请参阅示例部分)。
- Press the "Validate" button to find any errors in the file.
点击"Validate"按钮以查找文件中的错误。
- After the file is completely valid, assign the product configuration to your product using the Product Manager.
文件完全生效后,在 Product Manager把它指定为您的产品配置。
- View your product's order form and run a test order to ensure the configuration behaves how you expect.
查看产品订购单并进行订单测试,以保证配置正常运行。
Return to Main Menu
|