1515use Magento \Store \Model \ScopeInterface ;
1616use Magento \Store \Model \Store ;
1717use Magento \MediaStorage \Helper \File \Storage \Database ;
18- use \Magento \Directory \Api \CountryInformationAcquirerInterface ;
19- use \Magento \Directory \Model \RegionFactory ;
2018
2119/**
2220 * Template model class.
@@ -60,16 +58,6 @@ abstract class AbstractTemplate extends AbstractModel implements TemplateTypesIn
6058 */
6159 const XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT = 'design/email/logo_height ' ;
6260
63- /**
64- * Email country id
65- */
66- const XML_PATH_GENERAL_STORE_INFORMATION_COUNTRY_ID = 'general/store_information/country_id ' ;
67-
68- /**
69- * Email region id
70- */
71- const XML_PATH_GENERAL_STORE_INFORMATION_REGION_ID = 'general/store_information/region_id ' ;
72-
7361 /**
7462 * Configuration of design package for template
7563 *
@@ -177,16 +165,6 @@ abstract class AbstractTemplate extends AbstractModel implements TemplateTypesIn
177165 */
178166 private $ urlModel ;
179167
180- /**
181- * @var \Magento\Directory\Api\CountryInformationAcquirerInterface
182- */
183- protected $ countryInformationAcquirerInterface ;
184-
185- /**
186- * @var \Magento\Directory\Model\RegionFactory
187- */
188- protected $ regionFactory ;
189-
190168 /**
191169 * @var Database
192170 */
@@ -205,8 +183,6 @@ abstract class AbstractTemplate extends AbstractModel implements TemplateTypesIn
205183 * @param \Magento\Email\Model\TemplateFactory $templateFactory
206184 * @param \Magento\Framework\Filter\FilterManager $filterManager
207185 * @param \Magento\Framework\UrlInterface $urlModel
208- * @param CountryInformationAcquirerInterface $countryInformationAcquirerInterface
209- * @param RegionFactory $regionFactory
210186 * @param array $data
211187 * @param Database $fileStorageDatabase
212188 *
@@ -225,8 +201,6 @@ public function __construct(
225201 \Magento \Email \Model \TemplateFactory $ templateFactory ,
226202 \Magento \Framework \Filter \FilterManager $ filterManager ,
227203 \Magento \Framework \UrlInterface $ urlModel ,
228- CountryInformationAcquirerInterface $ countryInformationAcquirerInterface ,
229- RegionFactory $ regionFactory ,
230204 array $ data = [],
231205 Database $ fileStorageDatabase = null
232206 ) {
@@ -242,8 +216,6 @@ public function __construct(
242216 $ this ->templateFactory = $ templateFactory ;
243217 $ this ->filterManager = $ filterManager ;
244218 $ this ->urlModel = $ urlModel ;
245- $ this ->countryInformationAcquirerInterface = $ countryInformationAcquirerInterface ;
246- $ this ->regionFactory = $ regionFactory ;
247219 $ this ->fileStorageDatabase = $ fileStorageDatabase ?:
248220 \Magento \Framework \App \ObjectManager::getInstance ()->get (Database::class);
249221 parent ::__construct ($ context , $ registry , null , null , $ data );
@@ -540,12 +512,6 @@ protected function addEmailVariables($variables, $storeId)
540512 $ store
541513 );
542514 }
543- if (!isset ($ variables ['store_country ' ])) {
544- $ variables ['store_country ' ] = $ this ->getCountryName ($ store );
545- }
546- if (!isset ($ variables ['store_region ' ])) {
547- $ variables ['store_region ' ] = $ this ->getRegionName ($ store );
548- }
549515 // If template is text mode, don't include styles
550516 if (!$ this ->isPlain () && !isset ($ variables ['template_styles ' ])) {
551517 $ variables ['template_styles ' ] = $ this ->getTemplateStyles ();
@@ -807,46 +773,4 @@ public function getUrl(Store $store, $route = '', $params = [])
807773 }
808774 return $ url ->getUrl ($ route , $ params );
809775 }
810-
811- /**
812- * Get country name for the specified store.
813- *
814- * @param Store $store
815- * @return string
816- */
817- protected function getCountryName ($ store )
818- {
819- $ countryName = '' ;
820- $ store = $ this ->storeManager ->getStore ($ store );
821- $ countryId = $ this ->scopeConfig ->getValue (
822- self ::XML_PATH_GENERAL_STORE_INFORMATION_COUNTRY_ID ,
823- ScopeInterface::SCOPE_STORE ,
824- $ store
825- );
826- if ($ countryId ) {
827- $ countryName = $ this ->countryInformationAcquirerInterface ->getCountryInfo ($ countryId )->getFullNameLocale ();
828- }
829- return $ countryName ;
830- }
831-
832- /**
833- * Get region name for the specified store.
834- *
835- * @param Store $store
836- * @return string
837- */
838- protected function getRegionName ($ store )
839- {
840- $ regionName = '' ;
841- $ store = $ this ->storeManager ->getStore ($ store );
842- $ regionId = $ this ->scopeConfig ->getValue (
843- self ::XML_PATH_GENERAL_STORE_INFORMATION_REGION_ID ,
844- ScopeInterface::SCOPE_STORE ,
845- $ store
846- );
847- if ($ regionId ) {
848- $ regionName = $ this ->regionFactory ->create ()->load ($ regionId )->getName ();
849- }
850- return $ regionName ;
851- }
852776}
0 commit comments