0

I need to change price format from "10,00" to "10,-" . I have tried to find info, but all what i saw is: How to change "," to "." like this

How to change currency format in Magento 2?

(and btw it's not working for product page). And no info how to add few symbols after price. I know how to do it by jS but it's the last what i want to do.

1

You need to use extension attributes for /vendor/magento/framework/Pricing/PriceCurrencyInterface.php

in interface PriceCurrencyInterface

const DEFAULT_PRECISION = 2;

set value to 0

You cannot overwrite interfaces in Magento 2.

More about extensions attributes https://devdocs.magento.com/guides/v2.0/extension-dev-guide/extension_attributes/adding-attributes.html

and last if you need ,- like this 10,-

just add

span.price:after {
    content: ',-';
}
  • Thx for reply, i did all what is here aasim.kodefolks.com/magento-2/change-price-format-magento-2 and on product page i still can see price like "10,00" but should be like "10". But it's not my main question, so there is no way to add somewhere few symbols? Cause i don't need to change interface, i need to add. For example there are some function where all combines and show on front end ? – Herecomes Jul 23 '18 at 14:45
  • I update my answer, by adding span.price:after { content: ',-'; } change this that feet on your theme. – BartZalas Jul 24 '18 at 8:32
  • Thx for reply, i forgot about it. Though i still have problem with product page, but i think i must make other question. – Herecomes Jul 24 '18 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.