You are here:  » Display Price with comma


Display Price with comma

Submitted by koen on Thu, 2015-01-29 14:52 in

Hi David,

Things are getting better and better :-)
I've got one (last?) thing that I'can't get fixed....
Is is possible to display prices with a comma (like € 3,95) instead of € 3.95?
I've been searching the forums for hours but can't find the right code.

I think it must be somewhere close to the frontend, so after all the calculations, for example for shipping costs / the total price.

Thanks in advance, cheers,
Koen

Submitted by support on Thu, 2015-01-29 15:20

Hi Koen,

In keeping with the pending update to Price Tapestry future distributions of the plugin will have a single utility function for rendering the price. In the mean time, you can edit as follows:

Featured Products

Edit pto_featured.php and look for the following code at line 135:

  $each = str_replace("%PRICE%",$pto_config_currencyHTML.$row->minPrice,$each);

...and REPLACE with;

  $each = str_replace("%PRICE%",$pto_config_currencyHTML.str_replace(".",",",$row->minPrice),$each);

Search Results

Edit pto_search.php and look for the following code at line 553:

  $each = str_replace("%PRICE%",$pto_config_currencyHTML.$row->minPrice,$each);

...and REPLACE with;

  $each = str_replace("%PRICE%",$pto_config_currencyHTML.str_replace(".",",",$row->minPrice),$each);

Product Page

Edit pto_product.php and look for the following code at line 110:

  $each = str_replace("%PRICE%",$pto_config_currencyHTML.$product->price,$each);

...and REPLACE with;

  $each = str_replace("%PRICE%",$pto_config_currencyHTML.str_replace(".",",",$product->price),$each);

And also the following code at line 461:

  $html_product = str_replace("%PRICE%",$pto_config_currencyHTML.$product->price,$html_product);

...and REPLACE with:

  $html_product = str_replace("%PRICE%",$pto_config_currencyHTML.str_replace(".",",",$product->price),$html_product);

Hope this helps!

Cheers,
David.
--
PriceTapestry.com