Список товаров

Данные для шаблона списка товаров

Список товаров можно сформировать прямо в шаблоне функцией list_products, например:

{list_products where="product" orderby="bid_ya_desc" id=$v.id assign="products"}

Параметры для функции:

  • where - product или pub.
  • id - ID страницы от которой строится выборка.
  • assign - название массива, куда все будет записано
  • orderby - порядок сортировки. Доступные варианты: bid_ya, title, price; и для сортировки в обратном порядке: bid_ya_desc, price_desc и title_desc.

Список товаров доступен в массиве $page.list_products на страницах, где есть прикрепленные товары - список товаров или результат работы фильтра.

Массив каждого товара содержит следующие элементы: price, title или bid_ya

Array
(
    [accept_orders] => 1
    [active] => 1
    [alias] => item-1493708306
    [barcode] => 
    [bid_ya] => 0
    [categ2_alias] => page-2
    [categ2_id] => 184
    [categ2_title] => Подраздел
    [categ3_alias] => page-1
    [categ3_id] => 183
    [categ3_title] => Главный раздел
    [categ_alias] => page-3
    [categ_id] => 185
    [categ_title] => Активный раздел
    [clear] => 1 ** Указатель, что не выбраны фильтры
    [comment] => 
    [comments_qty] => 0
    [content] => 
    [currency] => rur
    [date] => 02.05.2017
    [date_insert] => 2017-05-02 10:18:59
    [date_update] => 2018-02-19 12:44:56
    [f_new] => 0
    [f_spec] => 0
    [files_qty] => 0
    [fotos_qty] => 1
    [id] => 195
    [id_categ] => 185
    [id_gift] => 0
    [id_next_model] => 0
    [id_required] => 0
    [id_site] => 28
    [intro] => 
    [link] => http://simpla.es/item-1493708306/
    [link_idn] => http://simpla.es/item-1493708306/
    [monthviews] => 1
    [pic] => Array
        (
            [1] => Array
                (
                    [id] => 8250
                    [title] => img.jpg
                    [ext] => jpg
                    [width] => 86
                    [height] => 65
                    [url] => http://simpla.es/upload/records/8250.jpg
                )

            [2] => Array
                (
                    [id] => 8251
                    [title] => img.jpg
                    [ext] => jpg
                    [width] => 191
                    [height] => 191
                    [url] => http://simpla.es/upload/records/8251.jpg
                )

            [3] => Array
                (
                    [id] => 8252
                    [title] => img.jpg
                    [ext] => jpg
                    [width] => 539
                    [height] => 404
                    [url] => http://simpla.es/upload/records/8252.jpg
                )

            [4] => Array
                (
                    [id] => 8253
                    [title] => img.jpg
                    [ext] => jpg
                    [width] => 290
                    [height] => 218
                    [url] => http://simpla.es/upload/records/8253.jpg
                )

        )

    [price] => 110888
    [price_formatted] => 110.888 
    [price_old] => 0
    [price_old_formatted] => 0
    [price_period] => razovo
    [products_qty] => 0
    [pubs_qty] => 0
    [sort1] => 99
    [sort2] => 99
    [sort3] => 99
    [time] => 10:18
    [title] => Название товара
    [title_short] => 
    [total_qty] => 0
    [user_id] => 200
    [views] => 34
    [weight_deliver] => 0.00
)

Данные собираются в функциях list_products и list_filter.