Country and province import fixture, is there any?


#1

Hi, is it possible to import to system all countries and province list automaticly?Is there any fixture?
I’m near deploy of my first sylius shop and it trades world wide - so I need to include all the countries and provinces there.


#2

Use \Sylius\Bundle\CoreBundle\Fixture\GeographicalFixture.
If you want all countries and provinces, then it’s probably better to extend this fixture and load the data from other sources, not from config files.
For countries you can use https://symfony.com/doc/current/components/intl.html#country-names.
You can also try https://github.com/commerceguys/addressing for both countries and provinces.
In short: get the data from somewhere and feed it to the GeographicalFixture.
More about fixtures in Sylius: http://docs.sylius.com/en/1.2/book/architecture/fixtures.html


#3

Thanks, as I thought - there is no ready-made solution. I’ll import data from my current ecommerce db.