How to Add custom text before product's price in product details page in Magento 2?
-
07-01-2021 - |
Вопрос
I am working with Magento 2.1.3 and i want to add some custom text before product's price in product details page.
Решение
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.
Не связан с magento.stackexchange