Advertisement:

Author Topic: [Tip] Region slug is empty in 3.3 in the osc_search_url work around  (Read 1060 times)

windson

  • Newbie
  • *
  • Posts: 22
For me the region slug is coming empty, so I modified the method osc_search_url($params=null) as below

at line 473 in /oc-includes/osclass/helpers/hSearch.php

replace the following code

$url .= osc_sanitizeString($region['s_slug']) . '-r' . $region['pk_i_id'];

with

if(!empty($region['s_slug']))
{
      $url .= osc_sanitizeString($region['s_slug']) . '-r' . $region['pk_i_id'];
}
else{
      $url .= osc_sanitizeString($region['s_name']) . '-r' . $region['pk_i_id'];
}

serjuc11111

  • Hero Member
  • *****
  • Posts: 814
Re: [Tip] Region slug is empty in 3.3 in the osc_search_url work around
« Reply #1 on: March 27, 2014, 02:47:22 pm »
slug for the region is not empty, I think you mean the city slug
space and any character will be removed..so can just update database table copy s_name to s_slug!
if your region are empty,try to enter manually slug in database!
how many region do u have?30-40-50? this dont take to long time to fill that field...
for city slug, if u have 3000 city in your database a manually work is not the best solution!


byteGator

  • Osclass Hero
  • Sr. Member
  • *
  • Posts: 346
  • Simple Mind is a Beautiful Mind
Re: [Tip] Region slug is empty in 3.3 in the osc_search_url work around
« Reply #2 on: March 28, 2014, 11:34:54 am »
As I remember, there is a function to build city slug in oc-admin. But I forgot where is it.