PDA

View Full Version : remove countries



Acte Immo
August 22, 2016, 03:43 PM
Hi,

In Multi-field/Geo filteringCountry

how to remove all countries other than one by one to keep only one ?

Thank you.

Curtis
August 23, 2016, 02:01 AM
Hi,

In Multi-field/Geo filteringCountry

how to remove all countries other than one by one to keep only one ?

Thank you.

You can remove it from database via phpMyAdmin only. In current version it's not possible via admin panel.
P.S. You need make a full backup before any changes in database.

Acte Immo
August 24, 2016, 03:05 PM
Thank you Curtis

can you build me a SQL query to keep only the France?

If this does not take too long for you.

Thank you

Curtis
August 27, 2016, 01:22 PM
Thank you Curtis

can you build me a SQL query to keep only the France?

If this does not take too long for you.

Thank you

Hello Acte,

You can use the following template for it (don't forget make a backup of database before any changes)

1. {db_prefix} - replace to your prefix
2. {country_key} - replace to key of your country (for example: france)



DELETE`T1`, `T2` FROM `{db_prefix}_data_formats` AS `T1` LEFT JOIN `{db_prefix}_lang_keys` AS `T2` ON`T2`.`Key` = CONCAT('data_formats+name+', `T1`.`Key`) WHERE `T1`.`Key` LIKE'countries_%' AND `T1`.`Key` NOT REGEXP '^countries_{country_key}.*'

Acte Immo
August 28, 2016, 09:41 AM
Perfect Curtis !

Thank you for all.

Stefan Popadiin
March 9, 2017, 02:23 PM
Hi Curtis,

I am trying to do the same as Acte Immo, but unsuccessfully.

I run query

SELECT`T1`, `T2` FROM `fl_data_formats` AS `T1` LEFT JOIN `fl_lang_keys` AS `T2` ON`T2`.`Key` = CONCAT('data_formats+name+', `T1`.`Key`) WHERE `T1`.`Key` LIKE'countries_%' AND `T1`.`Key` NOT REGEXP '^countries_bulgaria.*'
But in throws error: #1054 - Unknown column 'T1' in 'field list'

Using

DELETE`T1`, `T2` FROM `fl_data_formats` AS `T1` LEFT JOIN `fl_lang_keys` AS `T2` ON`T2`.`Key` = CONCAT('data_formats+name+', `T1`.`Key`) WHERE `T1`.`Key` LIKE'countries_%' AND `T1`.`Key` NOT REGEXP '^countries_bulgaria.*'
Does not produce anything either.

BR.,

First I would like to know if country Active/Inactive flag has a purpose and what

Curtis
March 10, 2017, 09:51 AM
Hello Stefan,

Use the following query for selection:



SELECT `T1`.`ID`, `T1`.`Key`, `T2`.`Value` FROM `{db_prefix}_data_formats` AS `T1`
LEFT JOIN `{db_prefix}_lang_keys` AS `T2` ON`T2`.`Key` = CONCAT('data_formats+name+', `T1`.`Key`)
WHERE `T1`.`Key` LIKE 'countries_%' AND `T1`.`Key` NOT LIKE '^countries\_bulgaria\_%'

Stefan Popadiin
March 13, 2017, 12:41 AM
Thanks Curtis,

Meanwhile I have inactivated all unnecessary countries and the flag seems to work ok. One should erase cookies after inactivation, otherwise strange behaviour appears in country list.

Curtis
March 14, 2017, 08:30 AM
Thanks Curtis,

Meanwhile I have inactivated all unnecessary countries and the flag seems to work ok. One should erase cookies after inactivation, otherwise strange behaviour appears in country list.

Hello Stefan,

Yes, you're right, the old location data saved in cookies and system will try redirect you to old location.