We sacrifice by not doing any other technology, so that you get the best of Magento.

We sacrifice by not doing any other technology, so that you get the best of Magento.

    There is this code which used to get price with currency.  Let’s see how to get it.

    We can use below helper price to get it.

    <?php
    use MagentoFrameworkPricingHelperData
    protected $priceHelper;
    public function __construct(Data $priceHelper)
    {
        $this->priceHelper = $priceHelper;
    }
    public function getFormattedPrice($price)
    {
        return $this->priceHelper->currency($price, true, false);
    }
    ?>

    Also, we can use directly in phtml file

    $this->helper('MagentoFrameworkPricingHelperData')->currency(number_format(50,2),true,false);

     

    field_5bfb909c5ccae

      Get a Free Quote