3

I have setup multi store view with multiple currency. Everything is working as expected.

Now, I got requirement to convert all prices into ceil. (e.g, SR20.02 = SR21). For this task, I have developed my own module on which I have override Magento\Framework\Pricing\Render\Amount and Magento\Tax\Block\Item\Price\Renderer and converted into ceil. I also have overrided price-utils.js for knockout js file rendering in summary. Everything is working correctly except grandtotal. I am not getting expected grandtotal.

In \Magento\Framework\Pricing\Render\Amount

Method overrided:

 /**
 * Format price value
 *
 * @param float $amount
 * @param bool $includeContainer
 * @param int $precision
 * @return float
 */
public function formatCurrency(
    $amount,
    $includeContainer = true,
    $precision = 0 
) {
    return $this->priceCurrency->format($amount, $includeContainer, $precision);
}

in \Magento\Tax\Block\Item\Price\Renderer

Method overrided:

 public function formatPrice($price)
{
    $item = $this->getItem();
    if ($item instanceof QuoteItem) {
        return $this->priceCurrency->format(
            $price,
            true,
            0,
            $item->getStore()
        );
    } elseif ($item instanceof OrderItem) {
        return $item->getOrder()->formatPrice($price);
    } else {
        return $item->getOrderItem()->getOrder()->formatPrice($price);
    }
}

I need help. Thanks

enter image description here

Your Answer

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

Browse other questions tagged or ask your own question.