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

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form