Commit 62ffca64b8f356287d3ebdeea97728cb4ea77223

Authored by Alex Savenko
1 parent 8fd6962f

sitemap controller fix noindex

Showing 1 changed file with 39 additions and 39 deletions   Show diff stats
console/controllers/SiteMapController.php
@@ -180,45 +180,45 @@ class SiteMapController extends Controller @@ -180,45 +180,45 @@ class SiteMapController extends Controller
180 } 180 }
181 } 181 }
182 } 182 }
183 -//  
184 -// //filters 1 lvl  
185 -// foreach($this->getCategories() as $category) {  
186 -// foreach ($this->getFilters($category) as $filter) {  
187 -// if($this->checkFilter($category, [$filter['group_alias'] => [$filter['option_alias']]])){  
188 -// $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter['group_alias'] => [$filter['option_alias']]] ]);  
189 -// $this->createRow($url , 0.8, $content);  
190 -// }  
191 -//  
192 -// }  
193 -// }  
194 -//  
195 -// //seo links  
196 -// foreach($this->getSeoLinks() as $link) {  
197 -// $url = Yii::$app->urlManager->baseUrl.$link->url;  
198 -// $this->createRow($url , 0.7, $content);  
199 -//  
200 -// }  
201 -//  
202 -// //filters 2 lvl  
203 -// foreach($this->getCategories() as $category) {  
204 -// foreach ($this->getFilters($category) as $filter1) {  
205 -// foreach ($this->getFilters($category) as $filter2) {  
206 -// if($this->checkFilter($category, [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] )){  
207 -// $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] ]);  
208 -// $this->createRow($url , 0.7, $content);  
209 -// }  
210 -//  
211 -// }  
212 -//  
213 -// foreach ($this->getBrands($category) as $brand) {  
214 -// if($this->checkFilter($category, ['brands' => [$brand->brand_id], $filter1['group_alias'] => [$filter1['option_alias']]] )){  
215 -// $url = Url::to(['catalog/category', 'category' => $category, 'filters' => ['brands' => [$brand->alias],$filter1['group_alias'] => [$filter1['option_alias']]]]);  
216 -// $this->createRow($url , 0.7,$content);  
217 -// }  
218 -//  
219 -// }  
220 -// }  
221 -// } 183 +
  184 + //filters 1 lvl
  185 + foreach($this->getCategories() as $category) {
  186 + foreach ($this->getFilters($category) as $filter) {
  187 + if($this->checkFilter($category, [$filter['group_alias'] => [$filter['option_alias']]])){
  188 + $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter['group_alias'] => [$filter['option_alias']]] ]);
  189 + $this->createRow($url , 0.8, $content);
  190 + }
  191 +
  192 + }
  193 + }
  194 +
  195 + //seo links
  196 + foreach($this->getSeoLinks() as $link) {
  197 + $url = Yii::$app->urlManager->baseUrl.$link->url;
  198 + $this->createRow($url , 0.7, $content);
  199 +
  200 + }
  201 +
  202 + //filters 2 lvl
  203 + foreach($this->getCategories() as $category) {
  204 + foreach ($this->getFilters($category) as $filter1) {
  205 + foreach ($this->getFilters($category) as $filter2) {
  206 + if($this->checkFilter($category, [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] )){
  207 + $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] ]);
  208 + $this->createRow($url , 0.7, $content);
  209 + }
  210 +
  211 + }
  212 +
  213 + foreach ($this->getBrands($category) as $brand) {
  214 + if($this->checkFilter($category, ['brands' => [$brand->brand_id], $filter1['group_alias'] => [$filter1['option_alias']]] )){
  215 + $url = Url::to(['catalog/category', 'category' => $category, 'filters' => ['brands' => [$brand->alias],$filter1['group_alias'] => [$filter1['option_alias']]]]);
  216 + $this->createRow($url , 0.7,$content);
  217 + }
  218 +
  219 + }
  220 + }
  221 + }
222 222
223 223
224 224