Model
Rule
Magento\Tax\Model\Calculation\Rule
What it does
This class manages tax calculation rules in Magento 2, which define how taxes are calculated by associating customer tax classes, product tax classes, and tax rates together.
Developers use this model to create, update, or retrieve tax rules that determine which tax rates apply to which customer and product combinations, including priority and calculation settings.
Public Methods
- afterSave()
- afterDelete()
- saveCalculationData()
- getCalculationModel()
- getRates()
- getCustomerTaxClasses()
- getProductTaxClasses()
- fetchRuleCodes()
- getCode()
- getPosition()
- getCalculateSubtotal()
- getPriority()
- getCustomerTaxClassIds()
- getProductTaxClassIds()
- getTaxRateIds()
- setCode()
- setPriority()
- setPosition()
- setCustomerTaxClassIds()
- setProductTaxClassIds()
- setTaxRateIds()
- setCalculateSubtotal()
- getExtensionAttributes()
- setExtensionAttributes()