Advertisement:

Author Topic: [SOLVED] Delete location without deleting ads.  (Read 234 times)

WEBmods

  • Hero Member
  • *****
  • Posts: 872
[SOLVED] Delete location without deleting ads.
« on: April 23, 2019, 12:02:57 am »
Hello!

I want to remove a country from my Osclass site but keep ads with that location. When I click "x" it says: "This action can't be undone. Items associated to this location will be deleted. Users from this location will be unlinked, but not deleted. Are you sure you want to continue?".

Items will be deleted, but users will be unlinked. Is there a way to unlink items without playing with the database and phpMyAdmin?

Thanks, regards.
« Last Edit: April 23, 2019, 06:15:07 pm by patrickFromCroatia »

jonnyWeb

  • Newbie
  • *
  • Posts: 12
Re: Delete location without deleting ads.
« Reply #1 on: April 23, 2019, 01:55:30 am »
t_item_location table is used to define all location of item published.
Maybe you can considerate disable a X country by javascript to users not publish that country on own items, and when the old items of that X country expired/deleted by butler plugin, you can delete x country to not affect items related.

Sorry, I can't imagine something better.

What do you meaned with "unlink items"?

Regards
« Last Edit: April 23, 2019, 02:04:06 am by jonnyWeb »

WEBmods

  • Hero Member
  • *****
  • Posts: 872
Re: Delete location without deleting ads.
« Reply #2 on: April 23, 2019, 06:14:55 pm »
I ran this query in phpMyAdmin:

Code: [Select]
UPDATE `oc_t_item_location` SET `fk_c_country_code` = NULL, `fk_i_region_id` = NULL, `fk_i_city_id` = NULL

After that, I deleted the country and ads weren't deleted.

Regards.

jonnyWeb

  • Newbie
  • *
  • Posts: 12
Re: [SOLVED] Delete location without deleting ads.
« Reply #3 on: April 23, 2019, 07:12:06 pm »
Sure, but and all users with location related to that country? I mean, they will lost your full location to that items. Well, you knows what is better to your website not me. That's why I suggested by javascript to remove country option, on select menu durin posting, and wait to expiration date to remove country, and items of these users will not would be affected with location "null".

Is a bit confused, beacuse if you don't want users from that X country, why that process to keep them without location? Now they cannot be searched by country/region/city.

Regards

WEBmods

  • Hero Member
  • *****
  • Posts: 872
Re: [SOLVED] Delete location without deleting ads.
« Reply #4 on: April 23, 2019, 07:37:18 pm »
First the site was only based in one country, but now I expanded it to worldwide. I don't want to import all countries in the world, but to have radius search and text fields for location.

Regards.

jonnyWeb

  • Newbie
  • *
  • Posts: 12
Re: [SOLVED] Delete location without deleting ads.
« Reply #5 on: April 23, 2019, 07:43:44 pm »
Ok, now I understand your decision.

Regards