Sponsorship Override

You can override the required percentage field in a sponsorship rule at runtime using catalog item template fields.

You can add additional catalog item template fields to catalogs, offers, and bundles by creating a custom MATRIXX Data Container (MDC) that derives from the MtxTemplateAttr MDC.

The following code example shows create_config.info details for the custom MDC:

Added MDC:00062:What is the container's name?CustomSponsorTemplateAttr
Added MDC:00062:What is the container's key?-62
Added MDC:00062:What is the name of the base container (if any)?MtxTemplateAttr
New CustomSponsorTemplateAttr field:How many fields do you want to add?1
New CustomSponsorTemplateAttr field:00001:What is the field's name?GoldPercentage
New CustomSponsorTemplateAttr field:00001:What is the field's type?decimal
Note: The CustomSponsorTemplateAttr field type must be decimal.

The pricing contains the overriding values to use in the catalog, bundle, or offer definitions, as shown in the following example:

<MtxCatalogItem>
  <RevArray>
    <MtxCatalogItemRev>
      <EffectiveDate>2008-09-27T00:00:00.000000</EffectiveDate>
      <TemplateId>5352315</TemplateId>
      <TemplateVersion>0</TemplateVersion>
      <TemplateAttr>
        <CustomSponsorTemplateAttr>
          <GoldPercentage>90</GoldPercentage>
        </CustomSponsorTemplateAttr>
      </TemplateAttr>
      <Rev>0</Rev>
      <Id>5352315</Id>
    </MtxCatalogItemRev>
  </RevArray>
  <Id>5352315</Id>
</MtxCatalogItem>

The override percentage can be defined in decimal format, for example 0.9, or in non-decimal format, for example 90.

The override percentage priority is in the following order of precedence:
  • Catalog item
  • Bundle
  • Product offer
  • Default value
You can also add additional custom purchased offer fields by creating a custom MDC that derives from the MtxPurchasedOffer MDC. This enables the fields to be provided as a part of the purchase operation. The override container and field names are a property of the sponsorship rule, for example:
<MtxSponsorRule>
    <Name>sponsorship rule 1002 purchase rating test</Name>
    <BalanceClassId>840</BalanceClassId>
    <BalanceTemplateId>8401000</BalanceTemplateId>
    <SponsorPct>0.2</SponsorPct>
    <ChargeType>original</ChargeType>
    <OverrideContainerName>CustomPurchasedOffer</OverrideContainerName>
    <OverrideFieldName>SponsorshipPct</OverrideFieldName>
    <Id>1002</Id>
</MtxSponsorRule>
Extending the MtxPurchasedOffer looks like this, for example:
Do you want to add any private MDCs (y/n)?y
How many private MDCs do you want to add?1
 
Added MDC:00001:What is the container's name?CustomPurchasedOffer
Added MDC:00001:What is the container's key?-9
Added MDC:00001:What is the name of the base container (if any)?MtxPurchasedOffer
Added MDC:00001:What is the created schema version?2
Added MDC:00001:What is the deleted schema version?0
 
New CustomPurchasedOffer field:How many fields do you want to add?1
New CustomPurchasedOffer field:00001:What is the field's name?SponsorshipPct
New CustomPurchasedOffer field:00001:What is the field's type?decimal
New CustomPurchasedOffer field:00001:Is this field a list (y/n)?n
New CustomPurchasedOffer field:00001:Is this field an array (y/n)?n
New CustomPurchasedOffer field:00001:What is the created schema version?2
New CustomPurchasedOffer field:00001:What is the deleted schema version?0
 
Added MDC:CustomPurchasedOfferExtension:What is the container's key?-104

The SponsorshipPct value can be provided as a part of the purchase operation.