0
は、私が知りたい、名前すべての店舗でmagento2.xの国名を変更、追加、削除する方法は? magento2.xにコードの下に使用
<?php
namespace Readymate\Samplemodule\Block;
class HelloWorld extends \Magento\Framework\View\Element\Template
{
protected $_countryCollectionFactory;
public function __construct(
\Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryCollectionFactory,
\Magento\Framework\View\Element\Template\Context $context,
array $data = []
) {
parent::__construct($context, $data);
$this->_countryCollectionFactory = $countryCollectionFactory;
}
public function getCountryCollection()
{
$collection = $this->_countryCollectionFactory->create()->loadByStore();
return $collection;
}
public function getCountries()
{
return $options = $this->getCountryCollection()
->toOptionArray();
}
}
と国のリストを見つけることができますが、どこロケール英語(米国」のmagento2.x店のすべての国の名前 ) "? 「マカオSAR中国」などの国名を「マカオ」に変更して、一部の国をリストから削除したいと考えています。