Step 1
Locate the line:
Add the folllowing code above:
$quote->setTotalsCollectedFlag(true);
$quote['dfSkipTotalsCollection'] = true;
Step 2
Replace the line:
with the following one:
if (!$quote->isVirtual() && $quote->getShippingAddress() && !$quote['dfSkipTotalsCollection']) {
Step 3
Replace the line:
with the following code block:
if (!$quote['dfSkipTotalsCollection']) {
$quote->setTotalsCollectedFlag(false)->collectTotals();
}
$quote->unsetData('dfSkipTotalsCollection');
$quote->save();