This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

kriskoyk

  • *****
  • 305 posts
Show "City Area"
« on: December 25, 2023, 09:49:24 PM »
In the entry there is the box to indicate the "City Area". it does not appear anywhere in the published post. How do I fix it?

*

MB Themes

Re: Show "City Area"
« Reply #1 on: December 26, 2023, 03:56:00 PM »
What theme it is?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 305 posts
Re: Show "City Area"
« Reply #2 on: December 26, 2023, 04:03:23 PM »
Beta

*

kriskoyk

  • *****
  • 305 posts
Re: Show "City Area"
« Reply #3 on: December 29, 2023, 06:09:36 PM »
Also, when the user enters an address, the exact address is not displayed on the google map, only the city. How do I fix this?

So this link in item.php  <a target="_blank"  class="direction" href="https://www.google.com/maps?daddr=<?php echo urlencode($location); ?>"><?php _e('Get directions', 'beta'); ?> <i class="fa fa-angle-right"></i></a> does not lead to the exact address, but to the City
« Last Edit: December 30, 2023, 06:23:06 PM by kriskoyk »

*

MB Themes

Re: Show "City Area"
« Reply #4 on: December 30, 2023, 08:59:01 PM »
Purpose of direction button is not to show seller house on map, in beta theme city, region & country are used to get location.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: Show "City Area"
« Reply #5 on: December 30, 2023, 08:59:39 PM »
Will check item page and city area in Jan
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 305 posts
Re: Show "City Area"
« Reply #6 on: December 31, 2023, 05:28:49 PM »
When we have a home for sale, the private seller wants the prospect to know the route to the item for sale.
I am using Osclass 3.x locations: for the locations and
I want to keep this old version because it's more convenient and that's why I'm looking for a solution.
Happy New Year

*

MB Themes

Re: Show "City Area"
« Reply #7 on: January 04, 2024, 09:38:18 PM »
You may update $location variable and add there osc_item_city_area(), osc_item_zip(), osc_item_address() - in way google will accept that.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 305 posts
Re: Show "City Area"
« Reply #8 on: January 05, 2024, 04:17:53 PM »
With the City Area OK
I have configured the code in ITEM.PHP on line 12 as follows:

$location_array = array(osc_item_city(), osc_item_region(), osc_item_country_code());
    $location_array = array_filter($location_array);
    $location = implode(', ', $location_array);

    $location2_array = array(osc_item_city(), osc_item_region(), osc_item_country_code(), osc_item_address(), osc_item_zip(), osc_item_city_area());
    $location2_array = array_filter($location_array);
    $location2 = implode(', ', $location_array);


and in line 184 as follows:

<div class="loc" <?php if(osc_images_enabled_at_items()) { ?>style="display:none;"<?php } ?>>
          <strong><?php echo $location; ?> <?php echo osc_item_address(); ?> <?php echo osc_item_zip(); ?></strong>

          <div class="hook">
            <?php osc_run_hook('location'); ?>
          </div>

          <a target="_blank"  class="direction" href="https://www.google.com/maps?daddr=<?php echo urlencode($location); ?>"><?php _e('Get directions', 'beta'); ?> <i class="fa fa-angle-right"></i></a>


I have a problem with the exact address. Google only recognizes the city and doesn't direct me to the exact address when I click on the download directions. How can I fix this?
« Last Edit: January 05, 2024, 04:19:45 PM by kriskoyk »

*

MB Themes

Re: Show "City Area"
« Reply #9 on: January 06, 2024, 09:23:08 AM »
I do not see that $location variable would contain address/zip/city area
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 305 posts
Re: Show "City Area"
« Reply #10 on: January 06, 2024, 09:59:00 AM »
I've tried this

$location_array = array(osc_item_city(), osc_item_region(), osc_item_country_code());
    $location_array = array_filter($location_array);
    $location = implode(', ', $location_array);

    $location2_array = array(osc_item_address(), osc_item_zip(), osc_item_city_area(), osc_item_city(), osc_item_region(), osc_item_country() );
    $location2_array = array_filter($location_array);
    $location2 = implode(', ', $location_array);


and this

$location_array = array(osc_item_address(), osc_item_zip(), osc_item_city_area(), osc_item_city(), osc_item_region(), osc_item_country());
    $location_array = array_filter($location_array);
    $location = implode(', ', $location_array);

    $location2_array = array(osc_item_address(), osc_item_zip(), osc_item_city_area(), osc_item_city(), osc_item_region(), osc_item_country() );
    $location2_array = array_filter($location_array);
    $location2 = implode(', ', $location_array);


 and none of them worked

*

kriskoyk

  • *****
  • 305 posts
Re: Show "City Area"
« Reply #11 on: January 06, 2024, 11:12:10 AM »
After testing I found that google does not recognize the locations as it is in version 3.x. That is, it does not recognize "Στρ.Σαράφη 4, Συκιές, Θεσσαλονίκη - Περ.Δήμοι GR" but it recognizes this: "Στρ.Σαράφη 4, Συκιές, Νομός Θεσσαλονίκης GR".
He does not recognize this: "Εγνατία 130, Καμάρα, Θεσσαλονίκη - Κέντρο, GR" but this: "Εγνατία 30, Θεσσαλονίκη, GR".
Probably all those locations it doesn't recognize should be changed, unless there is another solution.
« Last Edit: January 06, 2024, 11:20:57 AM by kriskoyk »

Marked as best answer by frosticek on January 10, 2024, 02:55:19 PM
*

kriskoyk

  • *****
  • 305 posts
Re: Show "City Area"
« Reply #12 on: January 08, 2024, 09:31:22 PM »
The issue was resolved as follows:
1)
Code: [Select]
$location_array = array(osc_item_address(), osc_item_zip(), osc_item_city());

2)
Code: [Select]
<?php osc_run_hook('item_images'); ?>
       
         <div class="loc" <?php if(osc_images_enabled_at_items()) { ?>style="display:none;"<?php ?>>
           <strong> <?php echo $location?>, <?php echo osc_item_city_area(); ?>, <?php echo osc_item_region(); ?>, <?php echo osc_item_country_code(); ?></strong>
« Last Edit: January 10, 2024, 02:55:31 PM by MB Themes »