Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

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.

 Signature 

--chris
Martini Lab, Web Design, Dallas, TX

 
Magento Community Magento Community
Magento Community
Magento Community
 
DavePit.com
Member
 
Avatar
Total Posts:  59
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

 Signature 

DavePit.com - My personal blog geared towards entrepreneurs
ActiveTuning
Tri Megatech

 
Magento Community Magento Community
Magento Community
Magento Community
 
DavePit.com
Member
 
Avatar
Total Posts:  59
Joined:  2007-08-31
 

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

 Signature 

DavePit.com - My personal blog geared towards entrepreneurs
ActiveTuning
Tri Megatech

 
Magento Community Magento Community
Magento Community
Magento Community
 
jnorton01
Jr. Member
 
Total Posts:  17
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
Jr. Member
 
Total Posts:  17
Joined:  2007-10-22
 
jnorton01 - 02 July 2008 06: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:  302
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 02:56 AM

jnorton01 - 02 July 2008 06: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 03: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:  302
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
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53278 users|767 users currently online|107382 forum posts