Commit 29f1675faa1f47eeabc41831f534a14a702e67db
1 parent
2e0d3422
site map
Showing
1 changed file
with
11 additions
and
1 deletions
Show diff stats
console/SiteMapController.php
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | use artweb\artbox\ecommerce\models\Brand; |
| 6 | 6 | use artweb\artbox\ecommerce\models\ProductVariant; |
| 7 | + use artweb\artbox\language\models\Language; | |
| 7 | 8 | use artweb\artbox\seo\models\Seo; |
| 8 | 9 | use artweb\artbox\ecommerce\models\Category; |
| 9 | 10 | use Yii; |
| ... | ... | @@ -30,6 +31,11 @@ |
| 30 | 31 | Yii::$app->urlManager->baseUrl.'/ru', |
| 31 | 32 | ]; |
| 32 | 33 | } |
| 34 | + | |
| 35 | + | |
| 36 | + public function getHost(){ | |
| 37 | + return Yii::$app->urlManager->baseUrl.'/ru'; | |
| 38 | + } | |
| 33 | 39 | |
| 34 | 40 | public function getVariants() |
| 35 | 41 | { |
| ... | ... | @@ -122,6 +128,10 @@ |
| 122 | 128 | |
| 123 | 129 | public function actionProcess() |
| 124 | 130 | { |
| 131 | + | |
| 132 | + Language::setCurrent('ru'); | |
| 133 | + | |
| 134 | + | |
| 125 | 135 | $config = ArrayHelper::merge( |
| 126 | 136 | require( \Yii::getAlias('@frontend/config/') . 'main.php' ), |
| 127 | 137 | require( \Yii::getAlias('@common/config/') . 'main.php' ) |
| ... | ... | @@ -216,7 +226,7 @@ |
| 216 | 226 | fclose($this->handle); |
| 217 | 227 | |
| 218 | 228 | $this->mainMap .= '<sitemap>'. |
| 219 | - '<loc>'.Yii::$app->urlManager->baseUrl.'/ru/' . $this->fileName . '</loc>'. | |
| 229 | + '<loc>'.$this->getHost().'/ru/' . $this->fileName . '</loc>'. | |
| 220 | 230 | '<lastmod>' . date('Y-m-d') . '</lastmod>'. |
| 221 | 231 | '</sitemap>'. |
| 222 | 232 | '</sitemapindex>'; | ... | ... |