Инструменты пользователя

Инструменты сайта


wiki:variable_comparison

Объект {$comparison}

Объект {$comparison} содержит всю информацию папки сравнения.


Структура объекта

[products] => Array
(
    [140] => stdClass Object
        (
            [id] => 140
            [url] => byustgalter-velmont-5104
            [brand_id] => 
            [position] => 140
            [created] => 2015-11-16 11:17:44
            [visible] => 1
            [featured] => 0
            [rating] => 0.0
            [votes] => 0
            [special] => 
            [last_modify] => 2015-11-27 11:15:17
            [name] => Бюстгальтер Velmont 5104
            [meta_title] => Бюстгальтер Velmont 5104
            [meta_keywords] => 
            [meta_description] => 
            [annotation] => 
            [body] => 
            [variants] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => 143
                            [product_id] => 140
                            [price] => 65.00
                            [compare_price] => 
                            [sku] => 664902047
                            [stock] => 10
                            [infinity] => 0
                            [attachment] => 
                            [position] => 1
                            [currency_id] => 2
                            [yandex] => 0
                            [rate_from] => 8.13
                            [rate_to] => 8.13
                            [name] => Белый
                        )
 
                )
 
            [images] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => 247
                            [product_id] => 140
                            [name] => 
                            [filename] => 152-289.jpg
                            [position] => 247
                        )
 
                )
 
            [features] => Array
                (
                    [1] => 
                )
 
            [variant] => stdClass Object
                (
                    [id] => 143
                    [product_id] => 140
                    [price] => 65.00
                    [compare_price] => 
                    [sku] => 664902047
                    [stock] => 10
                    [infinity] => 0
                    [attachment] => 
                    [position] => 1
                    [currency_id] => 2
                    [yandex] => 0
                    [rate_from] => 8.13
                    [rate_to] => 8.13
                    [name] => Белый
                )
 
            [image] => stdClass Object
                (
                    [id] => 247
                    [product_id] => 140
                    [name] => 
                    [filename] => 152-289.jpg
                    [position] => 247
                )
 
        )
 
    [139] => stdClass Object
        (
            [id] => 139
            [url] => byustgalter-velmont-4702
            [brand_id] => 0
            [position] => 139
            [created] => 2015-11-16 11:17:44
            [visible] => 1
            [featured] => 
            [rating] => 0.0
            [votes] => 0
            [special] => 
            [last_modify] => 2016-01-08 14:09:20
            [name] => Бюстгальтер Velmont 4702
            [meta_title] => Бюстгальтер Velmont 4702
            [meta_keywords] => 
            [meta_description] => 
            [annotation] => 
            [body] => 
            [variants] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => 141
                            [product_id] => 139
                            [price] => 63.05
                            [compare_price] => 
                            [sku] => 1047370142
                            [stock] => 10
                            [infinity] => 0
                            [attachment] => 
                            [position] => 141
                            [currency_id] => 2
                            [yandex] => 0
                            [rate_from] => 8.13
                            [rate_to] => 8.13
                            [name] => Белый
                        )
 
                    [1] => stdClass Object
                        (
                            [id] => 142
                            [product_id] => 139
                            [price] => 63.05
                            [compare_price] => 
                            [sku] => 1047370141
                            [stock] => 10
                            [infinity] => 0
                            [attachment] => 
                            [position] => 142
                            [currency_id] => 2
                            [yandex] => 0
                            [rate_from] => 8.13
                            [rate_to] => 8.13
                            [name] => Черный
                        )
 
                )
 
            [images] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => 246
                            [product_id] => 139
                            [name] => 
                            [filename] => 151-288.jpg
                            [position] => 0
                        )
 
                )
 
            [features] => Array
                (
                    [1] => 18-23
                )
 
            [variant] => stdClass Object
                (
                    [id] => 141
                    [product_id] => 139
                    [price] => 63.05
                    [compare_price] => 
                    [sku] => 1047370142
                    [stock] => 10
                    [infinity] => 0
                    [attachment] => 
                    [position] => 141
                    [currency_id] => 2
                    [yandex] => 0
                    [rate_from] => 8.13
                    [rate_to] => 8.13
                    [name] => Белый
                )
 
            [image] => stdClass Object
                (
                    [id] => 246
                    [product_id] => 139
                    [name] => 
                    [filename] => 151-288.jpg
                    [position] => 0
                )
 
        )
 
)
 
[features] => Array
(
    [1] => stdClass Object
        (
            [id] => 1
            [position] => 1
            [in_filter] => 1
            [yandex] => 1
            [auto_name_id] => 
            [auto_value_id] => 
            [url] => age
            [name] => Возраст
            [products] => Array
                (
                    [140] => 
                    [139] => 18-23
                )
 
            [not_unique] => 
        )
 
)
 
[ids] => Array
(
    [0] => 140
    [1] => 139
)

Подробнее о каждом свойстве

  • {$comparison->products} - полностью аналогичен массиву {$products}
  • {$comparison->features} - содержит массив свойств где ключ массива - это id свойства
  • {$comparison->ids} - массив содержащий все id товаров в папке сравнения

Подробнее о свойствах объекта {$comparison->features[x]}

[id] => 1
[position] => 1
[in_filter] => 1
[yandex] => 1
[auto_name_id] => 
[auto_value_id] => 
[url] => age
[name] => Возраст
[products] => Array
    (
        [140] => 
        [139] => 18-23
    )
 
[not_unique] =>
  • id - id свойства в БД
  • position - позиция свойства (сортировка)
  • in_filter - используется ли данное свойство в фильтре
  • yandex - выводить ли данное свойство в Я.Маркет
  • auto_name_id - ID свойства
  • auto_value_id - ID значения
  • url - URL свойства 1)
  • name - имя свойства
  • products - массив, ключи которого являются id товаров, а значениями значение этого свойства каждого товара
  • not_unique - не уникальные значения 2)
1) используется в ЧПУ фильтре
2) устанавливается в 1 в случае если значения данного свойства всех товаров в папке сравнения одинаковы. Если not_unique установлено в 1, то по нажатию на «Только отличия» в папке сравнения это свойство скрывается
wiki/variable_comparison.txt · Последние изменения: 2016/02/04 14:07 (внешнее изменение)