Countries
How to add a country?
/** @var CountryInterface $country */
$country = $this->container->get('sylius.factory.country')->createNew();
/** @var ProvinceInterface $province */
$province = $this->container->get('sylius.factory.province')->createNew();// US - the United States of America
$country->setCode('US');
// US_CA - California
$province->setCode('US_CA');$provinces = new ArrayCollection();
$provinces->add($province);
$country->setProvinces($provinces);Last updated
Was this helpful?
