M2.3.1 - Remove currency symbol from pricedifferent currency per productHow to add Space between Currency Symbol and Price?Magento 2 use symbol instead of name in currency switcherCan you add the current Currency Symbol to a CMS BlockMagento 2: How to get the product price with currency symbol in PHTML file with help of blockHow to pass price into my own div blockshow currency symbol of SAR in both store viewCurrency formating with html tagsMagento 1 remove currency symbol for product with custom optionsShow base currency price & display currency price at the same time in magento2?

Why not just directly invest in the holdings of an ETF?

What is the significance of 4200 BCE in context of farming replacing foraging in Europe?

Drawing lines to nearest point

Is the schwa sound consistent?

Front derailleur hard to move due to gear cable angle

How can I answer high-school writing prompts without sounding weird and fake?

Create a list of all possible Boolean configurations of three constraints

On studying Computer Science vs. Software Engineering to become a proficient coder

What are the components of a legend (in the sense of a tale, not a figure legend)?

What does the expression "right on the tip of my tongue" mean?

Reaction of borax with NaOH

Plastic-on-plastic lubricant that wont leave a residue?

Setting the major mode of a new buffer interactively

How to select certain lines (n, n+4, n+8, n+12...) from the file?

Usefulness of complex chord names?

Do atomic orbitals "pulse" in time?

Early arrival in Australia, early hotel check in not available

Proof that the inverse image of a single element is a discrete space

Was this a power play by Daenerys?

How are Core iX names like Core i5, i7 related to Haswell, Ivy Bridge?

What are the implications of the new alleged key recovery attack preprint on SIMON?

What happens if a creature that would fight isn't on the battlefield anymore?

Size of a folder with du

Is taking modulus on both sides of an equation valid?



M2.3.1 - Remove currency symbol from price


different currency per productHow to add Space between Currency Symbol and Price?Magento 2 use symbol instead of name in currency switcherCan you add the current Currency Symbol to a CMS BlockMagento 2: How to get the product price with currency symbol in PHTML file with help of blockHow to pass price into my own div blockshow currency symbol of SAR in both store viewCurrency formating with html tagsMagento 1 remove currency symbol for product with custom optionsShow base currency price & display currency price at the same time in magento2?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















Is it possible to get the price without currency symbol, or a way to put a div around the currency symbol to hide it with css?



$block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer())


If I remove the $block->formatCurrency I get the price without currency symbol, but a 1 will be added at the end of the price.



So I would like to put a div around the currency symbol and hide it with CSS.



Someone who can help me with that?



EDIT: I also want to add ,- behind the price.










share|improve this question






























    2















    Is it possible to get the price without currency symbol, or a way to put a div around the currency symbol to hide it with css?



    $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer())


    If I remove the $block->formatCurrency I get the price without currency symbol, but a 1 will be added at the end of the price.



    So I would like to put a div around the currency symbol and hide it with CSS.



    Someone who can help me with that?



    EDIT: I also want to add ,- behind the price.










    share|improve this question


























      2












      2








      2








      Is it possible to get the price without currency symbol, or a way to put a div around the currency symbol to hide it with css?



      $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer())


      If I remove the $block->formatCurrency I get the price without currency symbol, but a 1 will be added at the end of the price.



      So I would like to put a div around the currency symbol and hide it with CSS.



      Someone who can help me with that?



      EDIT: I also want to add ,- behind the price.










      share|improve this question
















      Is it possible to get the price without currency symbol, or a way to put a div around the currency symbol to hide it with css?



      $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer())


      If I remove the $block->formatCurrency I get the price without currency symbol, but a 1 will be added at the end of the price.



      So I would like to put a div around the currency symbol and hide it with CSS.



      Someone who can help me with that?



      EDIT: I also want to add ,- behind the price.







      magento2 price currency currency-symbol






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 8 at 9:21







      n00bly

















      asked May 8 at 9:12









      n00blyn00bly

      169113




      169113




















          2 Answers
          2






          active

          oldest

          votes


















          0














          Yes it is possible to get price without currency symbol by using below approach



          Instantiate MagentoDirectoryModelCurrency $priceCurrencyFormat class in constructor and use below code



          $this->priceCurrencyFormat->format($product->getPrice(), ['precision'=>0, 'display'=>Zend_Currency::NO_SYMBOL], 0);


          In second param of format() func you can also customize the price precision based on your requirement.



          You could also use below code to get your result, but it is not a good approach



          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $priceCurrencyFormat = $objectManager->get('MagentoDirectoryModelCurrency');
          $priceFormat = $priceCurrencyFormat->format($product->getPrice(), ['precision'=>0, 'display'=>Zend_Currency::NO_SYMBOL], 0);
          echo $priceFormat."-";





          share|improve this answer

























          • Hi, I can't find the file to edit. Are you sure is the correct path for Magento 2?

            – n00bly
            May 8 at 10:29











          • Directly editing the core file is not recommended, you should override the file in which you need your changes. In that overdid file (say you overdid any block file ) you can create the function with the above code and call it in your file.

            – Prabhu M.
            May 8 at 10:54











          • I have updated my answer, placing those 4 lines of code in your desired files will give you your desired result.

            – Prabhu M.
            May 8 at 11:13


















          0














          May be this will help you



          <?php 
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $currency = $objectManager->get('MagentoDirectoryModelCurrency');
          $price = 100;
          echo $currency->format($price, ['display'=>Zend_Currency::NO_SYMBOL], false);
          ?>





          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f273801%2fm2-3-1-remove-currency-symbol-from-price%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Yes it is possible to get price without currency symbol by using below approach



            Instantiate MagentoDirectoryModelCurrency $priceCurrencyFormat class in constructor and use below code



            $this->priceCurrencyFormat->format($product->getPrice(), ['precision'=>0, 'display'=>Zend_Currency::NO_SYMBOL], 0);


            In second param of format() func you can also customize the price precision based on your requirement.



            You could also use below code to get your result, but it is not a good approach



            $objectManager = MagentoFrameworkAppObjectManager::getInstance();
            $priceCurrencyFormat = $objectManager->get('MagentoDirectoryModelCurrency');
            $priceFormat = $priceCurrencyFormat->format($product->getPrice(), ['precision'=>0, 'display'=>Zend_Currency::NO_SYMBOL], 0);
            echo $priceFormat."-";





            share|improve this answer

























            • Hi, I can't find the file to edit. Are you sure is the correct path for Magento 2?

              – n00bly
              May 8 at 10:29











            • Directly editing the core file is not recommended, you should override the file in which you need your changes. In that overdid file (say you overdid any block file ) you can create the function with the above code and call it in your file.

              – Prabhu M.
              May 8 at 10:54











            • I have updated my answer, placing those 4 lines of code in your desired files will give you your desired result.

              – Prabhu M.
              May 8 at 11:13















            0














            Yes it is possible to get price without currency symbol by using below approach



            Instantiate MagentoDirectoryModelCurrency $priceCurrencyFormat class in constructor and use below code



            $this->priceCurrencyFormat->format($product->getPrice(), ['precision'=>0, 'display'=>Zend_Currency::NO_SYMBOL], 0);


            In second param of format() func you can also customize the price precision based on your requirement.



            You could also use below code to get your result, but it is not a good approach



            $objectManager = MagentoFrameworkAppObjectManager::getInstance();
            $priceCurrencyFormat = $objectManager->get('MagentoDirectoryModelCurrency');
            $priceFormat = $priceCurrencyFormat->format($product->getPrice(), ['precision'=>0, 'display'=>Zend_Currency::NO_SYMBOL], 0);
            echo $priceFormat."-";





            share|improve this answer

























            • Hi, I can't find the file to edit. Are you sure is the correct path for Magento 2?

              – n00bly
              May 8 at 10:29











            • Directly editing the core file is not recommended, you should override the file in which you need your changes. In that overdid file (say you overdid any block file ) you can create the function with the above code and call it in your file.

              – Prabhu M.
              May 8 at 10:54











            • I have updated my answer, placing those 4 lines of code in your desired files will give you your desired result.

              – Prabhu M.
              May 8 at 11:13













            0












            0








            0







            Yes it is possible to get price without currency symbol by using below approach



            Instantiate MagentoDirectoryModelCurrency $priceCurrencyFormat class in constructor and use below code



            $this->priceCurrencyFormat->format($product->getPrice(), ['precision'=>0, 'display'=>Zend_Currency::NO_SYMBOL], 0);


            In second param of format() func you can also customize the price precision based on your requirement.



            You could also use below code to get your result, but it is not a good approach



            $objectManager = MagentoFrameworkAppObjectManager::getInstance();
            $priceCurrencyFormat = $objectManager->get('MagentoDirectoryModelCurrency');
            $priceFormat = $priceCurrencyFormat->format($product->getPrice(), ['precision'=>0, 'display'=>Zend_Currency::NO_SYMBOL], 0);
            echo $priceFormat."-";





            share|improve this answer















            Yes it is possible to get price without currency symbol by using below approach



            Instantiate MagentoDirectoryModelCurrency $priceCurrencyFormat class in constructor and use below code



            $this->priceCurrencyFormat->format($product->getPrice(), ['precision'=>0, 'display'=>Zend_Currency::NO_SYMBOL], 0);


            In second param of format() func you can also customize the price precision based on your requirement.



            You could also use below code to get your result, but it is not a good approach



            $objectManager = MagentoFrameworkAppObjectManager::getInstance();
            $priceCurrencyFormat = $objectManager->get('MagentoDirectoryModelCurrency');
            $priceFormat = $priceCurrencyFormat->format($product->getPrice(), ['precision'=>0, 'display'=>Zend_Currency::NO_SYMBOL], 0);
            echo $priceFormat."-";






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited May 8 at 11:11

























            answered May 8 at 9:22









            Prabhu M.Prabhu M.

            509




            509












            • Hi, I can't find the file to edit. Are you sure is the correct path for Magento 2?

              – n00bly
              May 8 at 10:29











            • Directly editing the core file is not recommended, you should override the file in which you need your changes. In that overdid file (say you overdid any block file ) you can create the function with the above code and call it in your file.

              – Prabhu M.
              May 8 at 10:54











            • I have updated my answer, placing those 4 lines of code in your desired files will give you your desired result.

              – Prabhu M.
              May 8 at 11:13

















            • Hi, I can't find the file to edit. Are you sure is the correct path for Magento 2?

              – n00bly
              May 8 at 10:29











            • Directly editing the core file is not recommended, you should override the file in which you need your changes. In that overdid file (say you overdid any block file ) you can create the function with the above code and call it in your file.

              – Prabhu M.
              May 8 at 10:54











            • I have updated my answer, placing those 4 lines of code in your desired files will give you your desired result.

              – Prabhu M.
              May 8 at 11:13
















            Hi, I can't find the file to edit. Are you sure is the correct path for Magento 2?

            – n00bly
            May 8 at 10:29





            Hi, I can't find the file to edit. Are you sure is the correct path for Magento 2?

            – n00bly
            May 8 at 10:29













            Directly editing the core file is not recommended, you should override the file in which you need your changes. In that overdid file (say you overdid any block file ) you can create the function with the above code and call it in your file.

            – Prabhu M.
            May 8 at 10:54





            Directly editing the core file is not recommended, you should override the file in which you need your changes. In that overdid file (say you overdid any block file ) you can create the function with the above code and call it in your file.

            – Prabhu M.
            May 8 at 10:54













            I have updated my answer, placing those 4 lines of code in your desired files will give you your desired result.

            – Prabhu M.
            May 8 at 11:13





            I have updated my answer, placing those 4 lines of code in your desired files will give you your desired result.

            – Prabhu M.
            May 8 at 11:13













            0














            May be this will help you



            <?php 
            $objectManager = MagentoFrameworkAppObjectManager::getInstance();
            $currency = $objectManager->get('MagentoDirectoryModelCurrency');
            $price = 100;
            echo $currency->format($price, ['display'=>Zend_Currency::NO_SYMBOL], false);
            ?>





            share|improve this answer



























              0














              May be this will help you



              <?php 
              $objectManager = MagentoFrameworkAppObjectManager::getInstance();
              $currency = $objectManager->get('MagentoDirectoryModelCurrency');
              $price = 100;
              echo $currency->format($price, ['display'=>Zend_Currency::NO_SYMBOL], false);
              ?>





              share|improve this answer

























                0












                0








                0







                May be this will help you



                <?php 
                $objectManager = MagentoFrameworkAppObjectManager::getInstance();
                $currency = $objectManager->get('MagentoDirectoryModelCurrency');
                $price = 100;
                echo $currency->format($price, ['display'=>Zend_Currency::NO_SYMBOL], false);
                ?>





                share|improve this answer













                May be this will help you



                <?php 
                $objectManager = MagentoFrameworkAppObjectManager::getInstance();
                $currency = $objectManager->get('MagentoDirectoryModelCurrency');
                $price = 100;
                echo $currency->format($price, ['display'=>Zend_Currency::NO_SYMBOL], false);
                ?>






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 8 at 11:33









                Saphal JhaSaphal Jha

                874616




                874616



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f273801%2fm2-3-1-remove-currency-symbol-from-price%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?