Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Remove space between $ and price
 
Centerdesk, LLC
Jr. Member
 
Total Posts:  4
Joined:  2008-01-04
 

How can I get rid of the space between the $ and the price. i.e., I want to show $5.00, not $ 5.00.  Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Chris Williams
Member
 
Avatar
Total Posts:  67
Joined:  2007-09-02
Dallas, TX
 

I noticed that too.  I mentioned it in the bug report.

 
Magento Community Magento Community
Magento Community
Magento Community
 
davedavedave
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2007-08-31
 

I think the code is located here:

\app\design\frontend\default\default\template\catalog\product

But anytime I change anything, it’s not showing up on the frontend...so I’m not positive.  I see the similar sources though.  Maybe that will be a good start first clue smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
davedavedave
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2007-08-31
 

Doesn’t look like this was fixed in the most recent release.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jnorton01
Member
 
Total Posts:  49
Joined:  2007-10-22
 

If you are still having problems getting prices to display properly then edit the price.phtml template located at:
app/design/frontend/default/yourtheme/template/catalog/product/price.phtml - I am using the modern theme as a building block.

Basically, the default looks like this:
<?php echo Mage::helper('core')->currency($_price) ?>

Simply throw in a str_replace (if you can handle the overhead):
<?php echo str_replace (" ", "", Mage::helper('core')->currency($_price)) ?>

Remember to replace the strings for all other prices i.e. _minimalPrice, _finalPrice.

Hope this helps,

Justin.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jnorton01
Member
 
Total Posts:  49
Joined:  2007-10-22
 
jnorton01 - 02 July 2008 05:53 AM

If you are still having problems getting prices to display properly then edit the price.phtml template located at:
app/design/frontend/default/yourtheme/template/catalog/product/price.phtml - I am using the modern theme as a building block.

Basically, the default looks like this:
<?php echo Mage::helper('core')->currency($_price) ?>

Simply throw in a str_replace (if you can handle the overhead):
<?php echo str_replace (" ", "", Mage::helper('core')->currency($_price)) ?>

Remember to replace the strings for all other prices i.e. _minimalPrice, _finalPrice.

Hope this helps,

Justin.

*Update:

The above solution works for prices but renders the mark-up <span class="nobr">price</span> invalid i.e. <spanclass="nobr">price</span> - which isn’t valid HTML mark-up.

I can seem to find where the span is added to the price, so I guess it happens within core - I think waiting for a fix is the best idea.

Out of interest, does anyone know why HTML theme based mark-up is being added by core and is seemingly incapable of being overridden?

J.

 
Magento Community Magento Community
Magento Community
Magento Community
 
norbolig
Guru
 
Total Posts:  328
Joined:  2008-03-15
 

Just to make a note of it, the space between the currency sign and the price is actually correct syntax in most European countries.

I.e. NOK 5,00 and Euro 5,00 is correct displayed.

But for example in the UK, I believe they use £5.00.

 
Magento Community Magento Community
Magento Community
Magento Community
 
havocware
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2008-04-09
Chicago, IL
 
jnorton01 - 08 July 2008 01:56 AM

jnorton01 - 02 July 2008 05:53 AM
If you are still having problems getting prices to display properly then edit the price.phtml template located at:
app/design/frontend/default/yourtheme/template/catalog/product/price.phtml - I am using the modern theme as a building block.

Basically, the default looks like this:
<?php echo Mage::helper('core')->currency($_price) ?>

Simply throw in a str_replace (if you can handle the overhead):
<?php echo str_replace (" ", "", Mage::helper('core')->currency($_price)) ?>

Remember to replace the strings for all other prices i.e. _minimalPrice, _finalPrice.

Hope this helps,

Justin.

*Update:

The above solution works for prices but renders the mark-up <span class="nobr">price</span> invalid i.e. <spanclass="nobr">price</span> - which isn’t valid HTML mark-up.

I can seem to find where the span is added to the price, so I guess it happens within core - I think waiting for a fix is the best idea.

Out of interest, does anyone know why HTML theme based mark-up is being added by core and is seemingly incapable of being overridden?

J.

Yeah - core spitting out HTML formatting sucks, but you can get still use the above str_replace call with a small modification, just catch the “$space” instead of any “space” like this:

<?php echo str_replace ("\$ ""\$"Mage::helper('core')->currency($_price)) ?>

Worked for me.

- hw

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ures
Jr. Member
 
Total Posts:  6
Joined:  2008-07-08
 
norbolig - 08 July 2008 02:22 AM

Just to make a note of it, the space between the currency sign and the price is actually correct syntax in most European countries.

I.e. NOK 5,00 and Euro 5,00 is correct displayed.

But for example in the UK, I believe they use £5.00.

I think that it is good idea so far. But your magento will look more attractive ones you have your currencies signs unified

 
Magento Community Magento Community
Magento Community
Magento Community
 
norbolig
Guru
 
Total Posts:  328
Joined:  2008-03-15
 

@Ures: Yes, and not limited to currency sign! There are a lot of things that would be a lot easier if unified. Another magento challenge is the different shipping addresses, VAT numbers, etc. etc.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top