If the AB-test has been removed from the system since this price adjustment was created, this method returns null. This method always returns null for custom price adjustments.
If the AB-test, or this segment, has been removed from the system since this price adjustment was created, this method returns null. This method always returns null for custom price adjustments.
Discount
instance describing the discount applied to
obtain this price-adjustment. This method only returns a non-null value
if the price-adjustment was created
- when a discount-plan was applied to a basket, or
- as a custom price-adjustment using one of the methods ProductLineItem.createPriceAdjustment(String, Discount), ShippingLineItem.createShippingPriceAdjustment(String, Discount) or LineItemCtnr.createPriceAdjustment(String, Discount).
!isCustom()
instead.
If the campaign has been removed from the system since this price adjustment was created, this method returns null. This method always returns null for custom price adjustments.
Note: If the price adjustment was generated by a B2C Commerce promotion as part of an AB-test, then a Campaign object will be returned, but it is a mock implementation, and not a true Campaign. This behavior is required for backwards compatibility and should not be relied upon as it may change in future releases.
Note:If the price adjustment was generated by a B2C Commerce promotion as part of an AB-test, then an ID will be returned but it is not the ID of a true campaign. This behavior is required for backwards compatibility and should not be relied upon as it may change in future releases.
If an agent user has created the price adjustment, the agent user's name is returned. Otherwise "Customer" is returned.
A manual PriceAdjustment is one which has been added as a result of a user interaction e.g. by a user editing an order.
A non-manual PriceAdjustment is one which has been added for a different reason, e.g. by custom logic which automatically adjusts the price of particular products when certain conditions are met.
If the promotion has been removed from the system since this price adjustment was created, or if the promotion still exists but is not assigned to any campaign or AB-test, this method returns null. If the promotion has been reassigned to a different campaign or AB-test since this price adjustment was created, then the system will return an appropriate Promotion instance. This method always returns null for custom price adjustments.
The definition of "related" product line items depends on the type of promotion which generated this price adjustment:
- For order promotions, price adjustments are prorated across all product line items which are not explicitly excluded by the promotion. Custom order price adjustments apply to all items in the LineItemCtnr.
- For Buy-X-Get-Y product promotions, price adjustments are prorated across all items all product line items that are involved in the promotion, meaning that the PLI has one or more items contributing to the qualifying product count (i.e. the item is one of the X) or receiving the discount (i.e. the item is one of the Y).
- Other product promotions are not prorated and simply adjust the parent product line item, and so the returned map is of size 1.
- For shipping promotions, this method returns an empty map.
Order promotions are prorated sequentially upon non-excluded items according to the order in which they applied during promotion processing.
The values in the map are inclusive of tax if this price adjustment is based on gross pricing, and exclusive of tax otherwise. The sum of the prorated prices always equals the price of this price adjustment.
For custom price adjustments, not generated by the promotions engine, this method always returns 0.
Discount
instance describing the discount applied to obtain this price-adjustment.If the AB-test has been removed from the system since this price adjustment was created, this method returns null. This method always returns null for custom price adjustments.
null
if it was not based on an AB-test.
If the AB-test, or this segment, has been removed from the system since this price adjustment was created, this method returns null. This method always returns null for custom price adjustments.
null
if it was not based on an AB-test.
Discount
instance describing the discount applied to
obtain this price-adjustment. This method only returns a non-null value
if the price-adjustment was created
- when a discount-plan was applied to a basket, or
- as a custom price-adjustment using one of the methods ProductLineItem.createPriceAdjustment(String, Discount), ShippingLineItem.createShippingPriceAdjustment(String, Discount) or LineItemCtnr.createPriceAdjustment(String, Discount).
If the campaign has been removed from the system since this price adjustment was created, this method returns null. This method always returns null for custom price adjustments.
Note: If the price adjustment was generated by a B2C Commerce promotion as part of an AB-test, then a Campaign object will be returned, but it is a mock implementation, and not a true Campaign. This behavior is required for backwards compatibility and should not be relied upon as it may change in future releases.
null
if it was not based on a campaign.
Note:If the price adjustment was generated by a B2C Commerce promotion as part of an AB-test, then an ID will be returned but it is not the ID of a true campaign. This behavior is required for backwards compatibility and should not be relied upon as it may change in future releases.
null
if it was not based on a campaign.
If an agent user has created the price adjustment, the agent user's name is returned. Otherwise "Customer" is returned.
If the promotion has been removed from the system since this price adjustment was created, or if the promotion still exists but is not assigned to any campaign or AB-test, this method returns null. If the promotion has been reassigned to a different campaign or AB-test since this price adjustment was created, then the system will return an appropriate Promotion instance. This method always returns null for custom price adjustments.
The definition of "related" product line items depends on the type of promotion which generated this price adjustment:
- For order promotions, price adjustments are prorated across all product line items which are not explicitly excluded by the promotion. Custom order price adjustments apply to all items in the LineItemCtnr.
- For Buy-X-Get-Y product promotions, price adjustments are prorated across all items all product line items that are involved in the promotion, meaning that the PLI has one or more items contributing to the qualifying product count (i.e. the item is one of the X) or receiving the discount (i.e. the item is one of the Y).
- Other product promotions are not prorated and simply adjust the parent product line item, and so the returned map is of size 1.
- For shipping promotions, this method returns an empty map.
Order promotions are prorated sequentially upon non-excluded items according to the order in which they applied during promotion processing.
The values in the map are inclusive of tax if this price adjustment is based on gross pricing, and exclusive of tax otherwise. The sum of the prorated prices always equals the price of this price adjustment.
For custom price adjustments, not generated by the promotions engine, this method always returns 0.
!isCustom()
instead.
A manual PriceAdjustment is one which has been added as a result of a user interaction e.g. by a user editing an order.
A non-manual PriceAdjustment is one which has been added for a different reason, e.g. by custom logic which automatically adjusts the price of particular products when certain conditions are met.
Note that only custom PriceAdjustment can be marked as manual/non-manual.
A manual PriceAdjustment is one which has been added as a result of a user interaction e.g. by a user editing an order.
A non-manual PriceAdjustment is one which has been added for a different reason, e.g. by custom logic which automatically adjusts the price of particular products when certain conditions are met.