0

subtotal roundup

In above image showing product price KWD0.245 but Summary section Subtotal showing KWD0.250 (Automatic roundup) , how to avoid subtotal automatic roundup. I want to show subtotal as KWD0.245.

Thank You

1 Answer 1

0

you can use plugin for that

Create di.xml at app/code/Vendor/Module/etc/di.xml

then here you can override this core class Magento\Quote\Model\Quote

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Quote\Model\Quote">
        <plugin name="CustomQuote" type="Vendor\Module\Model\Quote" sortOrder="1" />
    </type>
</config>

then you can create your plugin class and override the magento method responsible for collecting total amount

<?php

namespace Vendor\Module\Model;

class Quote
{
    public function beforeCollectTotals() {
        //your logic here
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.