OS Property support center

Name of City

  • Sixella
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #134496 by Sixella
Name of City was created by Sixella
Hi,
How can i make for appear the city name ONLY and NOT FULL ADDRESS in the property listing ?
Thx
Attachments:

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #134500 by Mr. Dam
Replied by Mr. Dam on topic Name of City
Hi,
Currently, OS Property doesn't have option to hide Address of properties. But you can follow below steps to hide Address of properties.
1. Open file: root -> components -> com_osproperty -> helpers -> helper.php
2. Find:
Code:
$address[1] = self::loadCityName($property->city); $address[2] = self::loadSateCode($property->state); $address[3] = $property->region; $address[4] = $property->postcode;

and change to
Code:
$address[0] = self::loadCityName($property->city); $address[1] = self::loadSateCode($property->state); $address[2] = $property->region; $address[3] = $property->postcode;

Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Sixella
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #134502 by Sixella
Replied by Sixella on topic Name of City
Thx Mr. Dam,
But i looking to change in root => components => com_osproperty => templates => my_theme => listing.html.tpl.php

something like :
Code:
echo OSPHelper::generateAddress($row);

and replace with
Code:
echo row->name_of_the_city

Thx a lot :blush:

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #134506 by Mr. Dam
Replied by Mr. Dam on topic Name of City
OK Sixella

Please Log in or Create an account to join the conversation.

  • Sixella
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago - 3 years 11 months ago #134507 by Sixella
Replied by Sixella on topic Name of City
Mr. Dam,

Do you have any idea for make call to db #__osrs_cities for getting the name of the city like this:

"echo $row->city"

this method is very simple like a "echo $row->agent_name" ???


Thank you very much

Sixella
Last edit: 3 years 11 months ago by Sixella.

Please Log in or Create an account to join the conversation.

  • Sixella
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #134626 by Sixella
Replied by Sixella on topic Name of City
Hi everyone,

If anybody have the answer for my question???

Thx to all

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #134627 by Mr. Dam
Replied by Mr. Dam on topic Name of City
Hi,
In Helper of OS Property, we have the library function to call the Name of City directly through this command:
OSPHelper::loadCityName($city_id)
You just need to pass ID of the city into above code, you will have City name
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Sixella
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #134695 by Sixella
Replied by Sixella on topic Name of City
Thanx Mr Dam, but i'ts not working...

I try with :
OSPHelper::loadCityName($city_id)
and
OSPHelper::loadCityName($city)

and i'ts not working :(((

I find in helper.php this one :

$fields = array_keys($db->getTableColumns('#__osrs_cities'));
$extraLanguages = self::getLanguages();
if (count($extraLanguages)) {
foreach ($extraLanguages as $extraLanguage) {
$prefix = $extraLanguage->sef;
if (!in_array('city_' . $prefix, $fields)) {
return false;

and normally when i type :

<?php echo OSPHelper::loadCityName($city_id)?>

in listing.html.tpl.php near the name of property or just after

<?php echo OSPHelper::generateAddress($row)?>

it must working, but NO!

Help please !

Please Log in or Create an account to join the conversation.

More
3 years 10 months ago #134702 by Mr. Dam
Replied by Mr. Dam on topic Name of City
Hi,
I am confusing with your changes, please let me know exactly what you want, and i will let you know where and how you can make the change
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Sixella
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 5 months ago #139133 by Sixella
Replied by Sixella on topic Name of City
Hi Dam,

So, i add just one line in \administrator\components\com_osproperty\classes\configuration\properties\property.php
$addressArr = array();
$addressArr[0] = JText::_('OS_ADDRESS');
$addressArr[1] = JText::_('OS_CITY');
$addressArr[2] = JText::_('OS_STATE');
$addressArr[3] = JText::_('OS_REGION');
$addressArr[4] = JText::_('OS_POSTCODE');

$optionArr = array();
$optionArr[0] = "0,1,2,3,4";
$optionArr[1] = "0,1,4,2,3";
$optionArr[2] = "0,1,4,3,2";
$optionArr[3] = "0,1,3,4,2";
$optionArr[4] = "0,1,3,2,4";
$optionArr[5] = "0,4,1,2";
$optionArr[6] = "1";

And i'll see in config just CITY as i want :)

So, now i can add a zip code only or zip code + city name... etc, but not adresse complet

Thx Dam
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamNguyen Phu Quan