Spree::Adjustmentmodel in a storefront which handles this by allowing either positive or negative values.
amountThe dollar amount of the adjustment.
label: The label for the adjustment to indicate what the adjustment is for.
eligible: Indicates if the adjustment is eligible for the thing it's adjusting.
mandatory: Indicates if this adjustment is mandatory; i.e that this adjustment must be applied regardless of its eligibility rules.
state: Can either be
closed. Once an adjustment is closed, it will not be automatically updated.
included: Whether or not this adjustment affects the final price of the item it is applied to. Used only for tax adjustments which may themselves be included in the price.
Spree::TaxRateobject or a
labelattribute can be used as a good indicator of where the adjustment is coming from.
open: All open adjustments.
tax: All adjustments which have a source that is a
price: All adjustments which adjust a
shipping: All adjustments which adjust a
promotion: All adjustments where the source is a
optional: All adjustments which are not
return_authorization: All adjustments where the source is a
eligible: Adjustments which have been determined to be
eligiblefor their adjustable. Useful for determining which adjustments are applying to the adjustable.
charge: Adjustments which increase the price of their adjustable.
credit: Adjustments which decrease the price of their adjustable.
included: Adjustments which are included in the object's price. Typically tax adjustments.
additional: Adjustments which modify the object's price. The default for all adjustments.
Spree::Adjustmentclass itself, or on an
adjustmentsassociation. For example, calling any one of these three is valid:
Spree::Adjustable::Adjuster::Baseand implements an
Rails.application.config.spree.adjustersso it is included whenever adjustments are updated (Promotion and Tax are included by default):