Let’s initiate a discussion!!
When you pass price value phtml to js , you need to display price with currency from js.
Use ‘Magento_Catalog/js/price-utils’ priceUtils Js object in your custom javascript file to set currency to price.
Then add getFormattedPrice() function in your file to display currency symbol with price from javascript.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
define([ 'ko', 'Magento_Catalog/js/price-utils' ], function ( ko, priceUtils ) { 'use strict'; return { /** * Formats the price with currency format * * @param {number} * @return {string} */ getFormattedPrice: function (price) { var priceFormat = { decimalSymbol: '.', groupLength: 3, groupSymbol: ",", integerRequired: false, pattern: "₹%s", precision: 2, requiredPrecision: 2 }; return priceUtils.formatPrice(price, priceFormat); } } }); |
The search box is the most underrated functionality that is...
Managing and customizing Magento site can be a daunting task,...
Having an in-house eCommerce developer is very costly, and it...
Have you wonder why your conversions are less compare to...
According to a research, around 68% of eCommerce stores are...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.