Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save shipping discount in $total #5858

Merged
merged 1 commit into from
Mar 23, 2017
Merged

Save shipping discount in $total #5858

merged 1 commit into from
Mar 23, 2017

Conversation

flancer64
Copy link
Contributor

@flancer64 flancer64 commented Jul 28, 2016

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.
@ntekka
Copy link

ntekka commented Sep 1, 2016

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
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