<?php

return [
    'productsPerPage' => 10,
    'defaultProductsBaseSql' => 'SELECT c.cat_id, ct.cat_name, c.`cat_vat`, b.brand_id, b.brand_name, p.prod_id, p.prod_name, p.prod_timg, p.`prod_ifdisc`, 
                     p.prod_simg, p.prod_mimg, c.`cat_desc_type`, IF(c.`cat_desc_type` = \'s\', p.prod_atdes, p.prod_sdesc )  as sdesc, p.prod_price, p.pos_id, pt.pos_name, 
                    COALESCE( c.`cat_reg_disc` , cf.`reg_disc` , 0 ) AS `regdisc`, COALESCE( p.`prod_sticker` , pt.pos_sticker , NULL ) AS `sticker`, 
                    COALESCE( c.`cat_sale_disc` , cf.`sale_discount` , 0 ) AS `saledisc`, 
                    p.`prod_oldprice`, p.`prod_ifsale`, p.prod_if_price , r.slug , p.prod_sku, p.prod_weight, p.prod_status
                    FROM `config` cf,  `products` p  USE INDEX ( `pos_id` ) 
                    LEFT JOIN position_translations pt ON p.pos_id = pt.pos_id AND pt.lang  = :lang 
                    INNER JOIN brands b
                    USE INDEX ( `PRIMARY` ) ON p.brand_id = b.brand_id
                    INNER JOIN categories c
                    USE INDEX ( `PRIMARY` ) ON p.cat_id = c.cat_id 
                    INNER JOIN `category_translations` ct ON c.`cat_id` = ct.`cat_id` AND ct.`ct_lang` = :lang
                    INNER JOIN `routes` r ON p.`prod_id` = r.`object_id` AND r.`object` = "Product" AND r.`lang` = :lang ',

    'defaultProductsSelectSql' => 'SELECT c.cat_id, ct.cat_name,  c.`cat_vat`, b.brand_id, b.brand_name, p.prod_id, p.prod_name, p.prod_timg, p.`prod_ifdisc`, 
                     p.prod_simg, p.prod_mimg, c.`cat_desc_type`, IF(c.`cat_desc_type` = \'s\', p.prod_atdes, p.prod_sdesc )  as sdesc,  p.prod_price, p.pos_id, pt.pos_name, 
                    COALESCE( c.`cat_reg_disc` , cf.`reg_disc` , 0 ) AS `regdisc`, COALESCE( p.`prod_sticker` , pt.pos_sticker , NULL ) AS `sticker`, 
                    COALESCE( c.`cat_sale_disc` , cf.`sale_discount` , 0 ) AS `saledisc`, 
                    p.`prod_oldprice`, p.`prod_ifsale`, p.prod_if_price , r.slug , p.prod_sku, p.prod_weight, p.prod_status  ',

    'defaultProductsFromSql' => ' FROM `config` cf,  `products` p  USE INDEX ( `pos_id` ) 
                                LEFT JOIN position_translations pt ON p.pos_id = pt.pos_id AND pt.lang  = :lang 
                                INNER JOIN brands b
                                USE INDEX ( `PRIMARY` ) ON p.brand_id = b.brand_id
                                INNER JOIN categories c
                                USE INDEX ( `PRIMARY` ) ON p.cat_id = c.cat_id 
                                INNER JOIN `category_translations` ct ON c.`cat_id` = ct.`cat_id` AND ct.`ct_lang` = :lang  
                                INNER JOIN `routes` r ON p.`prod_id` = r.`object_id` AND r.`object` = "Product"  AND r.`lang` = :lang ',


];