Apply Cart Price Rule Discounts to Custom Fees#98
Merged
JosephLeedy merged 41 commits intorelease-1.4from Dec 30, 2025
Merged
Conversation
This reverts commit c280da9.
Fixes incompatibility with Magento versions 2.4.4, 2.4.5 and 2.4.6.
Fixes test failure in Magento 2.4.8 due to inconsistent select options data.
Code Coverage Report: 2025-12-30 00:07:15 Summary: Classes: 27.71% (23/83) Methods: 57.32% (188/328) Lines: 83.67% (2812/3361) JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 16/ 16) JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report\Filter\Form\CustomOrderFees Methods: 0.00% ( 0/ 1) Lines: 97.73% ( 43/ 44) JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report\Grid Methods: 100.00% ( 4/ 4) Lines: 100.00% (238/238) JosephLeedy\CustomFees\Block\Adminhtml\CustomOrderFees\Report\Grid\Column\Renderer\Currency\LocalizedFeeAmount Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 20/ 20) JosephLeedy\CustomFees\Block\Adminhtml\Sales\Order\Creditmemo\Create\Totals Methods: 60.00% ( 3/ 5) Lines: 75.51% ( 37/ 49) JosephLeedy\CustomFees\Block\Sales\Order\Creditmemo\Totals Methods: 80.00% ( 4/ 5) Lines: 97.73% ( 43/ 44) JosephLeedy\CustomFees\Block\Sales\Order\Invoice\Totals Methods: 60.00% ( 3/ 5) Lines: 95.92% ( 47/ 49) JosephLeedy\CustomFees\Block\Sales\Order\Totals Methods: 80.00% ( 4/ 5) Lines: 97.62% ( 41/ 42) JosephLeedy\CustomFees\Block\System\Config\Form\Field\CustomFees\Advanced\Form Methods: 50.00% ( 3/ 6) Lines: 84.62% ( 77/ 91) JosephLeedy\CustomFees\Controller\Adminhtml\Config\Export\ExampleCsv Methods: 100.00% ( 3/ 3) Lines: 100.00% ( 16/ 16) JosephLeedy\CustomFees\Controller\Adminhtml\Report\CustomOrderFees Methods: 75.00% ( 3/ 4) Lines: 80.56% ( 29/ 36) JosephLeedy\CustomFees\Controller\Adminhtml\Report\CustomOrderFees\Export\Csv Methods: 100.00% ( 1/ 1) Lines: 100.00% ( 4/ 4) JosephLeedy\CustomFees\Controller\Adminhtml\Report\CustomOrderFees\Export\Excel Methods: 100.00% ( 1/ 1) Lines: 100.00% ( 4/ 4) JosephLeedy\CustomFees\Controller\Adminhtml\System\Config\CustomFees\Advanced\Form Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 20/ 20) JosephLeedy\CustomFees\Controller\Adminhtml\System\Config\CustomFees\Advanced\NewConditionHtml Methods: 50.00% ( 1/ 2) Lines: 82.76% ( 24/ 29) JosephLeedy\CustomFees\Cron\AggregateCustomOrderFeesReport Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 26/ 26) JosephLeedy\CustomFees\Metadata\PropertyType Methods: 50.00% ( 1/ 2) Lines: 60.00% ( 6/ 10) JosephLeedy\CustomFees\Model\Checkout\ConfigProvider\CustomFees Methods: 50.00% ( 1/ 2) Lines: 81.82% ( 9/ 11) JosephLeedy\CustomFees\Model\Config Methods: 77.78% ( 7/ 9) Lines: 85.90% ( 67/ 78) JosephLeedy\CustomFees\Model\Config\Backend\CustomOrderFeesReport\AggregationCron Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 25/ 25) JosephLeedy\CustomFees\Model\Config\Backend\File\ImportCustomFees Methods: 80.00% ( 4/ 5) Lines: 93.14% ( 95/102) JosephLeedy\CustomFees\Model\CustomOrderFee Methods: 90.91% (30/33) Lines: 95.12% ( 78/ 82) JosephLeedy\CustomFees\Model\CustomOrderFee\Invoiced Methods: 50.00% ( 1/ 2) Lines: 66.67% ( 2/ 3) JosephLeedy\CustomFees\Model\CustomOrderFee\Refunded Methods: 50.00% ( 1/ 2) Lines: 66.67% ( 2/ 3) JosephLeedy\CustomFees\Model\CustomOrderFees Methods: 63.64% ( 7/11) Lines: 87.37% ( 83/ 95) JosephLeedy\CustomFees\Model\CustomOrderFeesRepository Methods: 33.33% ( 2/ 6) Lines: 33.33% ( 15/ 45) JosephLeedy\CustomFees\Model\DisplayType Methods: 0.00% ( 0/ 3) Lines: 30.77% ( 4/ 13) JosephLeedy\CustomFees\Model\FeeStatus Methods: 50.00% ( 1/ 2) Lines: 42.86% ( 3/ 7) JosephLeedy\CustomFees\Model\FeeType Methods: 33.33% ( 1/ 3) Lines: 27.27% ( 3/ 11) JosephLeedy\CustomFees\Model\ResourceModel\CustomOrderFees Methods: 75.00% ( 3/ 4) Lines: 50.00% ( 7/ 14) JosephLeedy\CustomFees\Model\ResourceModel\CustomOrderFees\Collection Methods: 100.00% ( 1/ 1) Lines: 100.00% ( 1/ 1) JosephLeedy\CustomFees\Model\ResourceModel\Report\CustomOrderFees Methods: 75.00% ( 3/ 4) Lines: 94.44% ( 51/ 54) JosephLeedy\CustomFees\Model\ResourceModel\Report\CustomOrderFees\Collection Methods: 75.00% ( 3/ 4) Lines: 94.87% ( 37/ 39) JosephLeedy\CustomFees\Model\Rule\Condition\Combine Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 47/ 47) JosephLeedy\CustomFees\Model\Rule\Condition\CustomFee Methods: 50.00% ( 4/ 8) Lines: 41.86% ( 18/ 43) JosephLeedy\CustomFees\Model\Rule\Condition\Product Methods: 0.00% ( 0/ 1) Lines: 66.67% ( 2/ 3) JosephLeedy\CustomFees\Model\Rule\Condition\Quote Methods: 20.00% ( 1/ 5) Lines: 27.78% ( 5/ 18) JosephLeedy\CustomFees\Model\Rule\Condition\QuoteAddress Methods: 71.43% ( 5/ 7) Lines: 86.84% ( 33/ 38) JosephLeedy\CustomFees\Model\Rule\CustomFees Methods: 50.00% ( 2/ 4) Lines: 86.67% ( 13/ 15) JosephLeedy\CustomFees\Model\Sales\Pdf\CustomFees Methods: 80.00% ( 4/ 5) Lines: 96.97% ( 64/ 66) JosephLeedy\CustomFees\Model\Total\Creditmemo\CustomFees Methods: 100.00% ( 5/ 5) Lines: 100.00% (306/306) JosephLeedy\CustomFees\Model\Total\Invoice\CustomFees Methods: 100.00% ( 3/ 3) Lines: 100.00% (111/111) JosephLeedy\CustomFees\Model\Total\Quote\CustomFees Methods: 100.00% ( 4/ 4) Lines: 100.00% ( 47/ 47) JosephLeedy\CustomFees\Model\Total\Quote\CustomFeesDiscount Methods: 75.00% ( 3/ 4) Lines: 97.56% ( 80/ 82) JosephLeedy\CustomFees\Model\Total\Quote\CustomFeesTax Methods: 85.71% ( 6/ 7) Lines: 98.50% (131/133) JosephLeedy\CustomFees\Observer\AddFieldToProductAttributeEditForm Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 16/ 16) JosephLeedy\CustomFees\Observer\BeforeQuoteSubmitObserver Methods: 50.00% ( 1/ 2) Lines: 91.67% ( 11/ 12) JosephLeedy\CustomFees\Plugin\Framework\View\Element\UiComponent\DataProvider\CollectionFactoryPlugin Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 13/ 13) JosephLeedy\CustomFees\Plugin\Framework\View\Element\UiComponent\DataProvider\DataProviderPlugin Methods: 50.00% ( 1/ 2) Lines: 90.62% ( 29/ 32) JosephLeedy\CustomFees\Plugin\Quote\Api\Data\TotalsInterfacePlugin Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 28/ 28) JosephLeedy\CustomFees\Plugin\Quote\Model\Cart\TotalsConverterPlugin Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 27/ 27) JosephLeedy\CustomFees\Plugin\Reports\Model\ResourceModel\Refresh\CollectionPlugin Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 20/ 20) JosephLeedy\CustomFees\Plugin\SalesRule\Model\Rule\Condition\Product\CombinePlugin Methods: 100.00% ( 1/ 1) Lines: 100.00% ( 5/ 5) JosephLeedy\CustomFees\Plugin\Sales\Api\CreditmemoRepositoryInterfacePlugin Methods: 50.00% ( 1/ 2) Lines: 92.31% ( 24/ 26) JosephLeedy\CustomFees\Plugin\Sales\Api\OrderRepositoryInterfacePlugin Methods: 100.00% ( 3/ 3) Lines: 100.00% ( 21/ 21) JosephLeedy\CustomFees\Plugin\Sales\Block\Order\TotalsPlugin Methods: 50.00% ( 1/ 2) Lines: 95.24% ( 20/ 21) JosephLeedy\CustomFees\Plugin\Sales\Model\Order\InvoicePlugin Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 28/ 28) JosephLeedy\CustomFees\Plugin\Ui\Component\AbstractComponentPlugin Methods: 50.00% ( 1/ 2) Lines: 93.88% ( 46/ 49) JosephLeedy\CustomFees\Service\ConditionsApplier Methods: 33.33% ( 1/ 3) Lines: 78.57% ( 11/ 14) JosephLeedy\CustomFees\Service\ConfigUpdater Methods: 42.86% ( 3/ 7) Lines: 82.76% ( 48/ 58) JosephLeedy\CustomFees\Service\CustomFeeDiscountRulesApplier Methods: 54.55% ( 6/11) Lines: 92.25% (131/142) JosephLeedy\CustomFees\Service\CustomFeesRetriever Methods: 40.00% ( 2/ 5) Lines: 90.62% ( 29/ 32) JosephLeedy\CustomFees\Service\CustomOrderFeeTaxValueAdder Methods: 66.67% ( 2/ 3) Lines: 96.77% ( 60/ 62) JosephLeedy\CustomFees\Service\CustomQuoteFeesRetriever Methods: 33.33% ( 1/ 3) Lines: 92.00% ( 23/ 25) JosephLeedy\CustomFees\Service\DataObjectPropertyTypeConverter Methods: 0.00% ( 0/ 3) Lines: 65.91% ( 58/ 88) JosephLeedy\CustomFees\Service\InvoicedCustomFeesRecorder Methods: 66.67% ( 2/ 3) Lines: 98.48% ( 65/ 66) JosephLeedy\CustomFees\Service\RefundedCustomFeesRecorder Methods: 100.00% ( 3/ 3) Lines: 100.00% ( 66/ 66) JosephLeedy\CustomFees\Setup\Patch\Data\CreateConditionProductAttribute Methods: 40.00% ( 2/ 5) Lines: 11.11% ( 3/ 27) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #92