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;
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
add a comment |
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
add a comment |
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
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
magento2 price currency currency-symbol
edited May 8 at 9:21
n00bly
asked May 8 at 9:12
n00blyn00bly
169113
169113
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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."-";
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
add a comment |
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);
?>
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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."-";
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
add a comment |
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."-";
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
add a comment |
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."-";
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."-";
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
add a comment |
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
add a comment |
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);
?>
add a comment |
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);
?>
add a comment |
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);
?>
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);
?>
answered May 8 at 11:33
Saphal JhaSaphal Jha
874616
874616
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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