Commit 367a13ab8c595d171f7750663eca34b3c8d6845f

Authored by Yarik
2 parents 2ffeed3d cfcd8d20

Merge remote-tracking branch 'origin/master'

console/SiteMapController.php
... ... @@ -118,7 +118,7 @@
118 118 $this->mapNumber++;
119 119  
120 120 $this->mainMap .= '<sitemap>'.
121   - '<loc>https://extremstyle.ua/ru/' . $this->fileName . '</loc>'.
  121 + '<loc>https://extremstyle.ua/' . $this->fileName . '</loc>'.
122 122 '<lastmod>' . date('Y-m-d') . '</lastmod>'.
123 123 '</sitemap>';
124 124  
... ... @@ -210,11 +210,14 @@
210 210 $this->createRow($url, 0.7);
211 211  
212 212 }
213   -
  213 +
214 214 foreach ($this->getCategoriesWithFilters() as $category) {
215 215 foreach ($category->taxGroups as $group) {
216   - if($group->is_filter && ($group->meta_robots != 'noindex,nofollow')){
217   - foreach ($group->taxOptions as $option) {
  216 + if($group->meta_robots == 'noindex,nofollow') {
  217 + continue;
  218 + }
  219 + if($group->is_filter){
  220 + foreach ($group->options as $option) {
218 221 $url = $urlManager->createAbsoluteUrl(
219 222 [
220 223 'catalog/category',
... ... @@ -226,6 +229,8 @@
226 229 }
227 230 }
228 231  
  232 +
  233 +
229 234  
230 235 }
231 236 }
... ... @@ -242,7 +247,7 @@
242 247 fclose($this->handle);
243 248  
244 249 $this->mainMap .= '<sitemap>'.
245   - '<loc>'.$this->getHost(). $this->fileName . '</loc>'.
  250 + '<loc>'.'https://extremstyle.ua/'. $this->fileName . '</loc>'.
246 251 '<lastmod>' . date('Y-m-d') . '</lastmod>'.
247 252 '</sitemap>'.
248 253 '</sitemapindex>';
... ...
helpers/CatalogFilterHelper.php
... ... @@ -211,7 +211,7 @@ class CatalogFilterHelper extends Object
211 211  
212 212  
213 213 $filterQuery = new Query();
214   - $filterQuery->source('id');
  214 + $filterQuery->source('*');
215 215 $filterQuery->from(Catalog::index(), Catalog::type());
216 216 if($in_stock){
217 217 $filterVO['nested']['path'] = 'variants';
... ...
helpers/XmlHelper.php 0 → 100755
  1 +<?php
  2 +
  3 + namespace artweb\artbox\ecommerce\helpers;
  4 +
  5 + use yii\base\Object;
  6 +
  7 + class XmlHelper extends Object
  8 + {
  9 + public static function createElement(string $name, string $value = '', array $attributes = [])
  10 + {
  11 + $element = '<' . $name;
  12 + foreach ($attributes as $key => $attribute) {
  13 + $element .= ' ' . $key . '="' . $attribute . '"';
  14 + }
  15 + $element .= '>' . $value . '</' . $name . '>';
  16 + return $element;
  17 + }
  18 + }
0 19 \ No newline at end of file
... ...
models/ProductFrontendSearch.php
... ... @@ -101,12 +101,14 @@
101 101 $dataProvider = new ActiveDataProvider(
102 102 [
103 103 'query' => $this->getSearchQuery($category, $params, $in_stock)->distinct()
  104 + ->select(['product.*','product_variant.price','product_lang.title'])
104 105 ->with('variant', 'videos','category.lang')
105 106 ->groupBy(
106 107 [
107 108 'product_lang.title',
108 109 'product_variant.price',
109 110 'product.id',
  111 + 'product_variant.id',
110 112 ]
111 113 ),
112 114 'pagination' => [
... ...