× OS Property support center

Name of City

  • Sixella
  • Sixella's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
1 week 5 days 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
1 week 5 days 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:
$address[1] = self::loadCityName($property->city);
$address[2] = self::loadSateCode($property->state);
$address[3] = $property->region;
$address[4] = $property->postcode;

and change to
$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
  • Sixella's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
1 week 5 days 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 :
echo OSPHelper::generateAddress($row);

and replace with
echo row->name_of_the_city

Thx a lot :blush:

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

More
1 week 4 days 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
  • Sixella's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
1 week 4 days ago - 1 week 4 days 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: 1 week 4 days ago by Sixella.

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

  • Sixella
  • Sixella's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
1 week 21 hours 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
1 week 21 hours 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
  • Sixella's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 days 15 hours 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
4 days 10 hours 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.

Moderators: Mr. DamNguyen Phu Quan