Hello!
Thank you for your request.
You can use str_replace function for replace comma with dot in es_get_the_formatted_field, es_get_the_area, es_get_the_lot_size filters. As a result Area and Lot size fields will display dots as delimiters in website front-end.
Regards,
Estatik.
Thread Starter
Rafał
(@ayek)
Dot → Comma
Eg. 120.55 m² → 120,55 m²
File:
\wp-content\plugins\estatik\templates\property\fields.php
copied as:
\wp-content\themes\my-theme\estatik\property\fields.php
Line: 17
<?php $value = is_array( $field[ key( $field ) ] ) ? implode( ', ', $field[ key( $field ) ] ) : $field[ key( $field ) ]; ?>
changed to:
<?php $value = is_array( $field[ key( $field ) ] ) ? implode( ', ', $field[ key( $field ) ] ) : str_replace('.',',',$field[ key( $field ) ]); ?>
Works for me.
Could do better?
Thread Starter
Rafał
(@ayek)
Better to use preg_replace function, so:
<?php $value = is_array($field[key($field)]) ? implode(', ', $field[key($field)]) : preg_replace('/(\d)\.(\d)/', '\1,\2', $field[key($field)]); ?>
Find a dot between two digits, then replace.
Thank you for your reply, Rafał!
Your modifications should work fine within one section – Basic facts. So, for example if you move Area and Lot Size fields to another section, the dot delimiter will appear again.
Regards,
Estatik.