Hi Sam,
Thank you for contacting us and I'll be happy to assist.
Before moving on to your specific questions, I'd like to confirm if I've understood your planned structure correctly.
The shops, cities, and provinces will have independent custom post types each and they'll be linked through two post-relationships ( ref: https://toolset.com/documentation/post-relationships/ ), so that:
1. A single province can have many cities (one-to-many relationship)
2. A single city can have many shops (one-to-many relationship)
If my understanding is correct, I'll move to your questions:
>> QUESTION 1: there's no need to create a slug by city name.
>> Is it possible to drop that functionality? In Belgium, there are
>> some cities that have the same name (e.g. 'Beveren). For the
>> first entry, the slug becomes 'beveren' and for the second entry
>> it becomes 'beveren-2'. On the front-end site, it will never need
>> the city slug.
- Creating post slugs by title is WordPress' default functionality, but this is correct that the slugs of the city and province type posts won't be used on the front-end since their role would be to store hierarchal relationship information for the main content, which is the shop type posts.
QUESTION 2: some cities also have the same zipcode (e.g. 'Zonnebeke => 8980' & 'Beselare => 8980'). So one record in the table 'cities' is only unique with the combination of the fields 'city name' and 'zipcode'. Can I do this with toolset so I can do a WP All Import on those two fields? Right now, WP All import deletes a bunch of records while importing because I can only select 'city name' or 'zipcode' as a unique field.
- If you're following the approach that I have described above, each city would be uniquely saved as a post item in the cities post type and any additional information like the city's 'zipcode' will be saved as a custom field value in that post item.
This way it won't be an issue, even if more than one cities will have the same zipcode value.
QUESTION 3: with question 1 and 2 in mind, will it be possible to add a simple dropdown with all city names in the 'shops' CRED? If 'no', I guess I have to handle the data on a complete other (database unfriendly) way?
- Yes, if cities and the shops posts will be in a relationship, you'll be able to add a field to select a city, when adding a new shop through a front-end Toolset Form (CRED).
( ref: https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/ )
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar