How to add image in knockout html template file Magento 2?

You can add an image to html (knockout) template to show images at a specific location in the checkout page of Magento 2.

In .html file, if you want to add a dynamic image from the theme or module’s web folder, You can be assigned images using the knockout template with ease. Continue reading “How to add image in knockout html template file Magento 2?”

How to set Price Format using javascript Magento 2.

Format a Price Using Javascript(JS) in Magento 2 for display a price with proper formating.

You have to use ‘Magento_Catalog/js/price-utils’ priceUtils Js Object in your javascript file to set format a price using javascript. Continue reading “How to set Price Format using javascript Magento 2.”

How to get Custom, Base Url in JS file Magento 2?

You can get the custom or base URL of store in javascript(JS) file for frontend area using ‘mage/url’ widgets.

You have to pass ‘mage/url’ widget as a dependency in a define([]) or require([]) function of the javascript file. Continue reading “How to get Custom, Base Url in JS file Magento 2?”