Commit 783ae9be0b50169f4588099ce10ee0594254f03f
1 parent
c79ebdb9
sitemap controller fix noindex
Showing
1 changed file
with
37 additions
and
37 deletions
Show diff stats
console/controllers/SiteMapController.php
@@ -194,43 +194,43 @@ class SiteMapController extends Controller | @@ -194,43 +194,43 @@ class SiteMapController extends Controller | ||
194 | } | 194 | } |
195 | 195 | ||
196 | //filters 1 lvl | 196 | //filters 1 lvl |
197 | -// foreach($this->getCategories() as $category) { | ||
198 | -// foreach ($this->getFilters($category) as $filter) { | ||
199 | -// if($this->checkFilter($category, [$filter['group_alias'] => [$filter['option_alias']]])){ | ||
200 | -// $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter['group_alias'] => [$filter['option_alias']]] ]); | ||
201 | -// $this->createRow($url , 0.8, $content); | ||
202 | -// } | ||
203 | -// | ||
204 | -// } | ||
205 | -// } | ||
206 | -// | ||
207 | -// //seo links | ||
208 | -// foreach($this->getSeoLinks() as $link) { | ||
209 | -// $url = Yii::$app->urlManager->baseUrl.$link->url; | ||
210 | -// $this->createRow($url , 0.7, $content); | ||
211 | -// | ||
212 | -// } | ||
213 | -// | ||
214 | -// //filters 2 lvl | ||
215 | -// foreach($this->getCategories() as $category) { | ||
216 | -// foreach ($this->getFilters($category) as $filter1) { | ||
217 | -// foreach ($this->getFilters($category) as $filter2) { | ||
218 | -// if($this->checkFilter($category, [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] )){ | ||
219 | -// $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] ]); | ||
220 | -// $this->createRow($url , 0.7, $content); | ||
221 | -// } | ||
222 | -// | ||
223 | -// } | ||
224 | -// | ||
225 | -// foreach ($this->getBrands($category) as $brand) { | ||
226 | -// if($this->checkFilter($category, ['brands' => [$brand->brand_id], $filter1['group_alias'] => [$filter1['option_alias']]] )){ | ||
227 | -// $url = Url::to(['catalog/category', 'category' => $category, 'filters' => ['brands' => [$brand->alias],$filter1['group_alias'] => [$filter1['option_alias']]]]); | ||
228 | -// $this->createRow($url , 0.7,$content); | ||
229 | -// } | ||
230 | -// | ||
231 | -// } | ||
232 | -// } | ||
233 | -// } | 197 | + foreach($this->getCategories() as $category) { |
198 | + foreach ($this->getFilters($category) as $filter) { | ||
199 | + if($this->checkFilter($category, [$filter['group_alias'] => [$filter['option_alias']]])){ | ||
200 | + $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter['group_alias'] => [$filter['option_alias']]] ]); | ||
201 | + $this->createRow($url , 0.8, $content); | ||
202 | + } | ||
203 | + | ||
204 | + } | ||
205 | + } | ||
206 | + | ||
207 | + //seo links | ||
208 | + foreach($this->getSeoLinks() as $link) { | ||
209 | + $url = Yii::$app->urlManager->baseUrl.$link->url; | ||
210 | + $this->createRow($url , 0.7, $content); | ||
211 | + | ||
212 | + } | ||
213 | + | ||
214 | + //filters 2 lvl | ||
215 | + foreach($this->getCategories() as $category) { | ||
216 | + foreach ($this->getFilters($category) as $filter1) { | ||
217 | + foreach ($this->getFilters($category) as $filter2) { | ||
218 | + if($this->checkFilter($category, [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] )){ | ||
219 | + $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] ]); | ||
220 | + $this->createRow($url , 0.7, $content); | ||
221 | + } | ||
222 | + | ||
223 | + } | ||
224 | + | ||
225 | + foreach ($this->getBrands($category) as $brand) { | ||
226 | + if($this->checkFilter($category, ['brands' => [$brand->brand_id], $filter1['group_alias'] => [$filter1['option_alias']]] )){ | ||
227 | + $url = Url::to(['catalog/category', 'category' => $category, 'filters' => ['brands' => [$brand->alias],$filter1['group_alias'] => [$filter1['option_alias']]]]); | ||
228 | + $this->createRow($url , 0.7,$content); | ||
229 | + } | ||
230 | + | ||
231 | + } | ||
232 | + } | ||
233 | + } | ||
234 | 234 | ||
235 | 235 | ||
236 | 236 |