Commit 3f16b0597e34f8e27c2b049c7dc05355dcd60cdb

Authored by Alex Savenko
1 parent dde8e67e

sitemap controller fix noindex

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