Ejemplo: Fragmentos XML de ajuste

Revisión de la representación XML de algunos ajustes comunes en el XML de la promoción de ejecución de un tipo de promoción puede ayudar a entender cómo personalizar un ajuste.

Ajuste de puntos de bonificación

<!-- This adjustment cannot be handled by the order subsystem. -->
<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.CustomNumericValueAdjustment">
   <CustomNumericValue>12</CustomNumericValue>

   <!-- Possible values are 
      wholeOrder: This adjustment is applied to the entire order as a whole.
      IndividualAffectedItem: This adjustment is applied to each and every 
          one of the affected order items.
      AllAfftectedItems: This adjustment is applied to all affected order 
          items as a whole.
             
      This attribute is common to all Adjustments.
        -->
   <AdjustmentType>wholeOrder</AdjustmentType>
</Adjustment>

Ajuste de importe fijo de descuento simple

<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedAmountOffAdjustment">
   <AmountOff>15</AmountOff>
   <Currency>USD</Currency>
   <AdjustmentType>wholeOrder</AdjustmentType>
</Adjustment>

Ajuste de importe fijo de descuento complejo

<!-- Applies to a set of order items, based on the quantity in the set, this assigns 
     different discount amounts to the items.
     -->
<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedAmountOffVolumeAdjustment">
   <AdjustmentType>IndividualAffectedItems</AdjustmentType>
   <Range>
      <AmountOff>15</AmountOff>
      <Currency>CAD</Currency>
      <LowerBound>1</LowerBound>
      <UpperBound>5</UpperBound>
      <LowerBoundIncluded>true</LowerBoundIncluded>
      <UpperBoundIncluded>true</UpperBoundIncluded>
   </Range>
   <Range>
      <AmountOff>25</AmountOff>
      <Currency>CAD</Currency>
      <LowerBound>6</LowerBound>
      <!-- -1 indicates unlimited -->
      <UpperBound>-1</UpperBound>
      <LowerBoundIncluded>true</LowerBoundIncluded>
      <UpperBoundIncluded>false</UpperBoundIncluded>
   </Range>
</Adjustment>

Ajuste de importe fijo de descuento en el envío

<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedAmountOffShippingAdjustment">
   <AmountOff>15</AmountOff>
   <Currency>CAD</Currency>
   <AdjustmentType>wholeOrder</AdjustmentType>
</Adjustment>

Ajuste de coste fijo

<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedCostAdjustment">
   <FixedCost>45</FixedCost>
   <Currency>CAD</Currency>
   <AdjustmentType>wholeOrder</AdjustmentType>
</Adjustment>

Ajuste de coste fijo en el envío

<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedCostShippingAdjustment">
   <FixedCost>15</FixedCost>
   <Currency>CAD</Currency>
   <AdjustmentType>wholeOrder</AdjustmentType>
</Adjustment>

Ajuste de regalo con compra

<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FreePurchasableGiftAdjustment">
    <GiftItem>
        <CatalogEntryKey>
            <SKU>SKU-20101099</SKU>
            <DN>o=Root Organization</DN>
        </CatalogEntryKey>
    </GiftItem>
    <Quantity>1</Quantity>
    <!-- Possible values are:
        0: As needed: If there are any items in the shop cart that satisfy free 
                      gift description, that item will be marked down by 100%. 
                      If there is not or there is not enough, free gifts will be 
                      added.

        1: Always add: Regardless of what is in the shopcart add the free gifts.
        2: Never add: Never add free gift, if the shoppers are to get the free 
                      gifts, they have to put the gifts into the shop cart by 
                      themselves.
         -->
    <AddStrategy>0</AddStrategy>
    <AdjustmentType>wholeOrder</AdjustmentType>
</Adjustment>

Ajuste de porcentaje de descuento

<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.PercentOffAdjustment">
   <Percentage>15</Percentage>
   <AdjustmentType>wholeOrder</AdjustmentType>
</Adjustment>

Ajuste de porcentaje de descuento en el envío

<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.PercentOffShippingAdjustment">
    <PercentOff>10</PercentOff>
    <AdjustmentType>wholeOrder</AdjustmentType>
</Adjustment>

Ajuste de cupón emitido por bonificación de promoción

<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.VoucherAdjustment">
    <PromotionKey>
        <PromotionName>20% Off Any Purchase</PromotionName>
        <StoreKey>
            <DN>Root Organization</DN>
            <Identifier>Store 201</Identifier>
        </StoreKey>
        <Version>2</Version>
        <Revision>1</Revision>
    </PromotionKey>
    <AdjustmentType>wholeOrder</AdjustmentType>
</Adjustment>

Importe fijo de descuento en el precio de oferta estándar, precio de contrato o precio con descuento

<Adjustment impl= "com.ibm.commerce.marketing.promotion.reward.FixedAmountOffPriceAdjustment">

    <!-- Possible values are:
        -1: Standard offer price
        -2: Contract price 
        -3: Discounted price
         -->
    <PriceAdjustmentBase>-1</PriceAdjustmentBase>
    <AmountOff>15</AmountOff>
    <Currency>CAD</Currency>

    <!-- For B2B price adjustments this field is always IndividualAfftectedItems -->
    <AdjustmentType>IndividualAffectedItems</AdjustmentType>
</Adjustment>

Porcentaje de descuento en el precio de oferta estándar, precio de contrato o precio con descuento

<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.PercentOffPriceAdjustment">

   <!-- Possible values are:
       -1: Standard offer price
       -2: Contract price
       -3: Discounted price 
        -->
    <PriceAdjustmentBase>-1</PriceAdjustmentBase>
    <Percentage>15</Percentage>
    <AdjustmentType>IndividualAffectedItems</AdjustmentType>
</Adjustment>