*

pitbull

  • ***
  • 98 posts
Problem with item location - PLEASE HELP !!
« on: November 29, 2017, 07:22:51 PM »
I am using veronika theme and i have a very weird issue. My problem is that when i get the search results of items (list view) it doesnt display the location of the items. Instead it displays " Location not entered " for all of my items!!!!!. I double checked every single item to ensure that i entered a location and everything is ok. Also in item detail view the map displays without problem with the adress and the map marker..

I really cant understand why is this happens !!!!

« Last Edit: November 29, 2017, 08:29:34 PM by pitbull »

*

Dawid

  • ****
  • 149 posts
Re: Problem with item location !!
« Reply #1 on: November 29, 2017, 08:01:39 PM »
If have copy search.php , use Ftp and change this in folder- veronika theme . If sill its the same problem , write code search.php

*

pitbull

  • ***
  • 98 posts
Re: Problem with item location !!
« Reply #2 on: November 29, 2017, 08:12:36 PM »
i dont thin it has to do with search.php file

The code that displays the location inside the items list is inside the file loop-single.php

Code: [Select]
<?php echo veronika_location_format(osc_item_country(), osc_item_region(), osc_item_city()); ?>
and the function is inside the file functions.php

Code: [Select]
function veronika_location_format($country = null, $region = null, $city = null) {
  if($country <> '') {
    if(strlen($country) == 2) {
      $country_full = Country::newInstance()->findByCode($country);
    } else {
      $country_full = Country::newInstance()->findByName($country);
    }

    if($region <> '') {
      if($city <> '') {
        return $city . ' ' . __('in', 'veronika') . ' ' . $region . ($country_full['s_name'] <> '' ? ' (' . $country_full['s_name'] . ')' : '');
      } else {
        return $region . ' (' . $country_full['s_name'] . ')';
      }
    } else {
      if($city <> '') {
        return $city . ' ' . __('in', 'veronika') . ' ' . $country_full['s_name'];
      } else {
        return $country_full['s_name'];
      }
    }
  } else {
    if($region <> '') {
      if($city <> '') {
        return $city . ' ' . __('in', 'veronika') . ' ' . $region;
      } else {
        return $region;
      }
    } else {
      if($city <> '') {
        return $city;
      } else {
        return __('Location not entered', 'veronika');
      }
    }
  }
}

I am trying to understand why it doesnt works the last 7 hours !!!!!!!!!!!!!!!!!!

*

MB Themes

Re: Problem with item location - PLEASE HELP !!
« Reply #3 on: November 29, 2017, 08:40:44 PM »
@pitbull
In that function try to echo inputs

Code: [Select]
function veronika_location_format($country = null, $region = null, $city = null) {
  echo $country . ' - ' . $region . ' - ' . $city;

so first you see if there are some inputs or everything is blank.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

pitbull

  • ***
  • 98 posts
Re: Problem with item location - PLEASE HELP !!
« Reply #4 on: November 30, 2017, 02:15:20 PM »
@pitbull
In that function try to echo inputs

Code: [Select]
function veronika_location_format($country = null, $region = null, $city = null) {
  echo $country . ' - ' . $region . ' - ' . $city;

so first you see if there are some inputs or everything is blank.

Hi @frosticek. i just tried the code and the only thing it prints its just the 2 dashes " - - ". Any idea ??? ?

*

MB Themes

Re: Problem with item location - PLEASE HELP !!
« Reply #5 on: November 30, 2017, 02:23:02 PM »
@Pitbull
It means no values are put there in loop-single.
Code: [Select]
<?php echo veronika_location_format(osc_item_country(), osc_item_region(), osc_item_city()); ?>
Everything is correct there.

You can check i.e. if osc_item_country_code() returns something there.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots