How to add some text before price in product detail page in magento 2
-
07-01-2021 - |
题
How to add some text before price of product in product details page . for
example:- price - $200.00.
Guys any suggestion from your end.Thanks
解决方案
You need to make changes in price-box.js
which is placed at
/vendor/magento/module-catalog/view/base/web/js/price-box.js
Make sure you take this js in your custom theme folder and make changes on line number 22 near
priceTemplate: '<span class="price"><%- data.formatted %></span>'
Add your custom text after <span class="price">
Some thing like this,
priceTemplate: '<span class="price">Price - <%- data.formatted %></span>'
Done.