Index
MAIN MENU

Product Configuration Examples 产品配置示例


Title: Adding a "Where did you hear about this product?" prompt
Assumptions: The list with ID "1234" already exists.
<product-configuration>
  <fields>
    <section>
      <!-- Displays the product's fixed price -->
      <group type="product_price"/> 

      <!-- Display a quantity box -->
      <group type="quantity"/>
      
      <!-- Show the pre-defined system template group which displays a 
           prompt asking the user where they heard about a product --> 
      <include-global-template name="Heard About Group"/>  
    </section>
  </fields>

  <delivery>
    <!-- Deliver a code from the list with ID 1234 -->
    <deliver-standard-list id="1234"/> 
  </delivery>
</product-configuration>

Title: A required serial number field used to generate a license code
Assumptions: The algorithm named "MyLicenseGenerator" already exists.
<product-configuration>
  <fields>
    <section>
      <!-- Displays the product's fixed price -->
      <group type="product_price"/> 

      <!-- Display a quantity box -->
      <group type="quantity"/>
      
      <group>
        <display>Serial Number</display>
        
        <validation>
          <!-- Ensure that the customer does not leave it blank -->
          <require-value field="serial_number"/> 
        </validation>
        
        <contents>
          <textbox field="serial_number" display="Serial Number"/>
        </contents>
      </group>
    </section>
  </fields>

  <delivery>
    <deliver-license reference="license">
      <generate-license-code>
        <script>
          <!-- The recipient's name will be passed via this parameter -->
          <define-parameter name="license_name"/>
          <return>
            <!-- Execute the predefined algorithm, passing two parameters -->
            <algorithm name="MyLicenseGenerator">
              <parameters>
                <variable name="license_name"/>
                <value-of class="custom" field="serial_number"/>
              </parameters>
            </algorithm>
          </return>
        </script>
      </generate-license-code>
    </deliver-license>
  </delivery>

</product-configuration>

Title: Selecting a license type via a drop down box
Assumptions: Product price is set to "0". Product has a download file assigned to it.
<product-configuration>      
  <fields>
    <section>
      <group>
        <display>Order Type</display>
        <contents>
          <!-- Create a drop down box with two license options -->
          <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>
    <!-- Give the customer a link to download the file assigned to the product -->
    <deliver-standard-download/>   
  </delivery>
</product-configuration>

Title: Tiered / quantity based pricing
Assumptions: Product price is set to "0".
<product-configuration>      
  <fields>
    <section>
 
      <!-- Display a quantity box -->      
      <group type="quantity"/>
     
      <!-- Use the quantity-pricing field to automatically handle the tier -->
      <group>
        <display>Pricing</display>
  
        <contents>
          <quantity-pricing field="quantity_pricing" pricing="order">
            <unit-plural>Licenses</unit-plural>
            <level start="1" price="24.95"/>
            <level start="10" price="19.95"/>
            <level start="50" price="14.95"/>
          </quantity-pricing>
        </contents>
      </group>

    </section>
  </fields> 
  <delivery>
    <!-- Give every customer the same fixed license code -->
    <deliver-fixed-license code="WER87342XZ"/>   
  </delivery>
</product-configuration>

Title: Using a remote CGI script to generate a license code
Assumptions: A CGI script exists on your server to intercept the request
<product-configuration>

  <delivery>
    <deliver-license reference="license">
      <generate-license-code>
        <script>
          <!-- The recipient's name will be passed via this parameter -->
          <define-parameter name="license_name"/>
          <return>
            <!-- Execute the CGI script on the remote server -->
            <remote.connect url="http://www.mywebsite.com/anyfile.cgi" method="get">
              <remote.cgi-value name="regname"><variable name="license_name"/></remote.cgi-value>
            </remote.connect>
          </return>
        </script>
      </generate-license-code>
    </deliver-license>
  </delivery>

</product-configuration>

Title: Synchronize recipient data with a remote CGI
Assumptions: A CGI script exists on your server to intercept the request. A license generator named "MyLicenseGenerator" is setup.
<product-configuration>

  <delivery>
    <deliver-standard-algorithm name="MyLicenseGenerator" reference="license"/>

    <deliver-background>
      <script>

        <!-- Execute the CGI script on the remote server -->
        <remote.connect url="http://www.mywebsite.com/any.cgi" method="post">
          <remote.cgi-value name="fname"><value-of class="recipient" field="fname"/></remote.cgi-value>
          <remote.cgi-value name="lname"><value-of class="recipient" field="lname"/></remote.cgi-value>
          <remote.cgi-value name="country"><value-of class="recipient" field="country"/></remote.cgi-value>
          <remote.cgi-value name="license_name"><value-of class="delivery" field="license" index="license_name"/></remote.cgi-value>
          <remote.cgi-value name="license_code"><value-of class="delivery" field="license" index="license_code"/></remote.cgi-value>
        </remote.connect>

      </script>
    </deliver-background>
  </delivery>

</product-configuration>