Skip to content

Save shipping discount in $total#5858

Merged
magento-team merged 1 commit into
magento:developfrom
flancer64:patch-4
Mar 23, 2017
Merged

Save shipping discount in $total#5858
magento-team merged 1 commit into
magento:developfrom
flancer64:patch-4

Conversation

@flancer64

@flancer64 flancer64 commented Jul 28, 2016

Copy link
Copy Markdown
Contributor

Shipping discount should be accounted in the \Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector::getShippingDataObject:

        if ($total->getShippingDiscountAmount()) {
            if ($useBaseCurrency) {
                $itemDataObject->setDiscountAmount($total->getBaseShippingDiscountAmount());
            } else {
                $itemDataObject->setDiscountAmount($total->getShippingDiscountAmount());
            }
        }

but is not initialized in $total. Shipping tax (and tax for whole order) is wrong when shipping discount is used in sales rules cause shipping amount is not decreased to discount amount before tax calculation.

#4585

Shipping discount should be accounted in the \Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector::getShippingDataObject:

            if ($total->getShippingDiscountAmount()) {
                if ($useBaseCurrency) {
                    $itemDataObject->setDiscountAmount($total->getBaseShippingDiscountAmount());
                } else {
                    $itemDataObject->setDiscountAmount($total->getShippingDiscountAmount());
                }
            }

but is not initialized in $total.
@quan-ntekka

Copy link
Copy Markdown

Can we please prioritize this PR please? My team also needs this fix.

@vrann vrann self-assigned this Mar 20, 2017
@vrann vrann added this to the March 2017 milestone Mar 21, 2017
@magento-team magento-team merged commit 795716e into magento:develop Mar 23, 2017
@flancer64 flancer64 deleted the patch-4 branch March 24, 2017 07:09
@ishakhsuvarov

Copy link
Copy Markdown
Contributor

@flancer64 @ntekka Pull Request has now been merged into the develop branch. Thanks!

magento-engcom-team pushed a commit that referenced this pull request Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants