Osclass forums

Support forums => General help => 3.7.x => Topic started by: frosticek on June 06, 2017, 11:10:37 am

Title: 3.7.3 Search parameters question
Post by: frosticek on June 06, 2017, 11:10:37 am
Hello guys,
Has something changed on 3.7.3 regarding location parameters on search?

Does not work on 3.7.3
http://url.com/search/country,DZ

Does work on 3.6
Title: Re: 3.7.3 Search parameters question
Post by: dev101 on June 06, 2017, 12:32:48 pm
quick test: works fine on my end
Title: Re: 3.7.3 Search parameters question
Post by: _CONEJO on June 06, 2017, 01:36:49 pm
Works fine on my setup too. I don't remember modifying anything related to the search either (but it could happen)
Title: Re: 3.7.3 Search parameters question
Post by: Aficionado on June 06, 2017, 01:52:29 pm
Works ok in my multi-country site.

Is something special i should look for ?
Title: Re: 3.7.3 Search parameters question
Post by: crymatisticos on June 06, 2017, 03:10:03 pm
@Aficionado @_CONEJO
test this URLs
https://rawajnet.com/index.php?page=search&sOrder=dt_pub_date&iOrderType=desc&country=DZ&region=782629

https://rawajnet.com/index.php?page=search&sOrder=dt_pub_date&iOrderType=desc&sCountry=Algeria&sRegion=Alger
 they are search request same region
for the first it doesn't return results and for the second it does

I only replaced
country=DZ  by sCountry=Algeria
region=782629 by sRegion=Alger
in the url

and by the way I've reinstalled Osclass as fresh but the same problem still exist

if you can show me how to modify search.php or other files so I can pass location strings rather than codes
Title: Re: 3.7.3 Search parameters question
Post by: Aficionado on June 06, 2017, 03:17:56 pm
I'm trying this on my 28 counties site:


https://www.website.com/search/sOrder,dt_pub_date/iOrderType,desc/country,FR/region,781333/city,Aignoz

and works great. Shows everything available.

Following your example it shoudln't work ? Am i getting this right ?
Title: Re: 3.7.3 Search parameters question
Post by: _CONEJO on June 06, 2017, 03:18:54 pm
Could you check your rewrite rules ?
Title: Re: 3.7.3 Search parameters question
Post by: Aficionado on June 06, 2017, 03:19:20 pm
@Aficionado @_CONEJO
test this URLs
https://rawajnet.com/index.php?page=search&sOrder=dt_pub_date&iOrderType=desc&country=DZ&region=782629

https://rawajnet.com/index.php?page=search&sOrder=dt_pub_date&iOrderType=desc&sCountry=Algeria&sRegion=Alger
 they are search request same region
for the first it doesn't return results and for the second it does

I only replaced
country=DZ  by sCountry=Algeria
region=782629 by sRegion=Alger
in the url

and by the way I've reinstalled Osclass as fresh but the same problem still exist

if you can show me how to modify search.php or other files so I can pass location strings rather than codes

What is that

"cookie-action-side,done"

in your urls ? If you have done custom work, then we can't follow your problem.

Title: Re: 3.7.3 Search parameters question
Post by: _CONEJO on June 06, 2017, 03:30:14 pm
forget about rewrite rules,


could you check your t_item_location table? is there anything on fk_c_country_code ? are you sure it was working before?

could you debug your SQL to see the real query of the search?
Title: Re: 3.7.3 Search parameters question
Post by: crymatisticos on June 06, 2017, 03:37:21 pm

What is that

"cookie-action-side,done"

in your urls ? If you have done custom work, then we can't follow your problem.

@Aficionado
"cookie-action-side,done"  it a plugin related to zara theme i think it is used to remeber parameters like language ..etc

I've changed the theme to POP latest version

now retry with the URLs

https://rawajnet.com/index.php?page=search&sOrder=dt_pub_date&iOrderType=desc&country=DZ&region=782629

https://rawajnet.com/index.php?page=search&sOrder=dt_pub_date&iOrderType=desc&sCountry=Algeria&sRegion=Alger

the problem still exist
Title: Re: 3.7.3 Search parameters question
Post by: crymatisticos on June 06, 2017, 03:40:20 pm
Could you check your rewrite rules ?

These are my rewrite rules
@_CONEJO
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

which are the ones in permalink configuration
Title: Re: 3.7.3 Search parameters question
Post by: crymatisticos on June 06, 2017, 03:45:36 pm
I'm trying this on my 28 counties site:


https://www.website.com/search/sOrder,dt_pub_date/iOrderType,desc/country,FR/region,781333/city,Aignoz

and works great. Shows everything available.

Following your example it shoudln't work ? Am i getting this right ?

the link that you've provided return 404 error

my links returns different results for same search go on and check by yourself

the first generated by search button in the website the second I've modified the first generated url
Title: Re: 3.7.3 Search parameters question
Post by: _CONEJO on June 06, 2017, 03:47:46 pm

could you check your t_item_location table? is there anything on fk_c_country_code ? are you sure it was working before?

could you debug your SQL to see the real query of the search?
Title: Re: 3.7.3 Search parameters question
Post by: crymatisticos on June 06, 2017, 03:50:47 pm
forget about rewrite rules,


could you check your t_item_location table? is there anything on fk_c_country_code ? are you sure it was working before?

could you debug your SQL to see the real query of the search?

apparently all values are Null in fk_c_country_code

and this is a screenshot of the table
Title: Re: 3.7.3 Search parameters question
Post by: Aficionado on June 06, 2017, 03:51:34 pm
I'm trying this on my 28 counties site:


https://www.website.com/search/sOrder,dt_pub_date/iOrderType,desc/country,FR/region,781333/city,Aignoz

and works great. Shows everything available.

Following your example it shoudln't work ? Am i getting this right ?

the link that you've provided return 404 error

my links returns different results for same search go on and check by yourself

the first generated by search button in the website the second I've modified the first generated url

Of cource it returns 404, website.com is not a real url.....
Title: Re: 3.7.3 Search parameters question
Post by: crymatisticos on June 06, 2017, 03:55:25 pm
I'm trying this on my 28 counties site:


https://www.website.com/search/sOrder,dt_pub_date/iOrderType,desc/country,FR/region,781333/city,Aignoz

and works great. Shows everything available.

Following your example it shoudln't work ? Am i getting this right ?

the link that you've provided return 404 error

my links returns different results for same search go on and check by yourself

the first generated by search button in the website the second I've modified the first generated url

Of cource it returns 404, website.com is not a real url.....

 :o :o :o :o :o :o :o :o :o :o :o
so why you gave it as example
Title: Re: 3.7.3 Search parameters question
Post by: Aficionado on June 06, 2017, 03:58:03 pm
:o :o :o :o :o :o :o :o :o :o :o
so why you gave it as example

Dude, that was a real search from MY SITE that i removed the domain name, because i don't like to post publicly an urls of mine.

Is that clear now ?

Title: Re: 3.7.3 Search parameters question
Post by: _CONEJO on June 06, 2017, 03:59:56 pm
forget about rewrite rules,


could you check your t_item_location table? is there anything on fk_c_country_code ? are you sure it was working before?

could you debug your SQL to see the real query of the search?

apparently all values are Null in fk_c_country_code

and this is a screenshot of the table


So that's your problem, you are looking by country code (DZ) doesn't work because the fk_c_country_code column is null ...
Title: Re: 3.7.3 Search parameters question
Post by: crymatisticos on June 06, 2017, 04:01:42 pm
forget about rewrite rules,


could you check your t_item_location table? is there anything on fk_c_country_code ? are you sure it was working before?

could you debug your SQL to see the real query of the search?

apparently all values are Null in fk_c_country_code

and this is a screenshot of the table


So that's your problem, you are looking by country code (DZ) doesn't work because the fk_c_country_code column is null ...
How can I fix this
Title: Re: 3.7.3 Search parameters question
Post by: _CONEJO on June 06, 2017, 04:03:43 pm
Maybe it's related to some zara code, wher eyou using POP theme before or after this issue?


To fix it, just run on your database:

Code: [Select]
UPDATE oc_t_item_location SET fk_c_country_code = "DZ" WHERE s_country = "Algeria";


But if there's a bug somewhere, in a plugin or the theme or in the core, this will happen again.
Title: Re: 3.7.3 Search parameters question
Post by: crymatisticos on June 06, 2017, 04:13:51 pm
Maybe it's related to some zara code, wher eyou using POP theme before or after this issue?


To fix it, just run on your database:

Code: [Select]
UPDATE oc_t_item_location SET fk_c_country_code = "DZ" WHERE s_country = "Algeria";


But if there's a bug somewhere, in a plugin or the theme or in the core, this will happen again.

Thank you very much for your help

but it seems the problem is also with region and cities I'll try to find a way to do the same with them
an SQL query which seems to be complicated
Title: Re: 3.7.3 Search parameters question
Post by: crymatisticos on June 06, 2017, 04:48:15 pm
this is query for region
UPDATE oc_t_item_location, oc_t_region
SET    oc_t_item_location.fk_i_region_id = oc_t_region.pk_i_id
WHERE  oc_t_item_location.s_region = oc_t_region.s_name

this the query for city

UPDATE oc_t_item_location, oc_t_city
SET    oc_t_item_location.fk_i_city_id = oc_t_city.pk_i_id
WHERE  oc_t_item_location.s_city = oc_t_city.s_name
Title: Re: 3.7.3 Search parameters question
Post by: frosticek on June 06, 2017, 11:33:08 pm
@crymatisticos
Can you check if this happen for new listings as well? Otherwise your code will fix just historical issues.
Title: Re: 3.7.3 Search parameters question
Post by: crymatisticos on June 16, 2017, 05:30:08 pm
@crymatisticos
Can you check if this happen for new listings as well? Otherwise your code will fix just historical issues.

sorry for replying late
it's still happening and make the queries daily  to fix the issue
Title: Re: 3.7.3 Search parameters question
Post by: frosticek on June 20, 2017, 10:53:48 am
@crymatisticos
Do we have this situation now?
- country in it's table has defined country code
- country code is not stored in item table (item_location) ?