# [15-Jul-2023 11:58:30] /unisex/root/ 167.99.142.201

set names utf8

SELECT `ID` FROM `params` WHERE `FilterType` = 1 AND `Required` = 1 ORDER BY `params`.`PostDate` ASC;

SELECT
					`products`.`ID`,
					`products`.`UploadID`,
					`products`.`MonetaID`,
					`products`.`RefNumber`,
					`products`.`RefID`,
					`products`.`Brand`,
					`products`.`Image`,
					`products`.`Application`,
					`products`.`Season`,
					`products`.`Model`,
					`products`.`Size`,
					`products`.`EUFuel`,
					`products`.`EUWet`,
					`products`.`EUNoise`,
					`prices`.`UnitPrice`,
					`product_texts`.`Title`,
					`product_texts`.`URLLabel`,
					(
						SELECT
						    GROUP_CONCAT(DISTINCT CONCAT_WS('-', `product_params`.`ParamID`, (UPPER(TRIM(`product_params`.`ParamValue`)))) SEPARATOR '|') AS `Params`
						FROM
						    `product_params`
						    INNER JOIN `params` ON `params`.`ID` = `product_params`.`ParamID`
						WHERE
						    `product_params`.`ProductID` = `products`.`ID` AND
						    `params`.`FilterType` IN (1,2,3) AND
                			`params`.`Required` = 0
						GROUP BY
						    `product_params`.`ProductID`
					) AS `Params`
				FROM
					`products`
					INNER JOIN `prices` ON `prices`.`MonetaID` = `products`.`MonetaID`
					INNER JOIN `product_texts` ON `products`.`ID` = `product_texts`.`ProductID`
					
	                INNER JOIN `product_params` AS `Param0` ON
	                    `Param0`.`ProductID` = `products`.`ID` AND
	                    `Param0`.`ParamID` = 5 AND
	                    `Param0`.`ParamValue` = '15'
	                
				WHERE
					`products`.`Application` = 'P' AND
					`products`.`Season` IN('S') AND
					`product_texts`.`Language` = 'bg' AND
					`products`.`Visible` = 1
				GROUP BY
					`products`.`ID`
				ORDER BY
					`products`.`PostDate` ASC

SET SESSION group_concat_max_len = 10240

SELECT `ID` FROM `params` WHERE `FilterType` = 1 AND `Required` = 1 ORDER BY `params`.`PostDate` ASC;

(
                        SELECT
                            `param_texts`.`Title`,
                            `params`.`ID`,
                            GROUP_CONCAT(DISTINCT `PPV`.`ParamValue` SEPARATOR ',') AS `Values`
                        FROM
                            `products`
                            INNER JOIN `product_params` AS `PPV` ON `products`.`ID` = `PPV`.`ProductID`
                            INNER JOIN `params` ON `params`.`ID` = `PPV`.`ParamID`
                            INNER JOIN `param_texts` ON `params`.`ID` = `param_texts`.`ParamID`
                            
                        WHERE
                            `products`.`Application` = 'P' AND
                            `products`.`Season` IN('S') AND
                            `params`.`ID` = 5 AND
                            `params`.`FilterType` = 1 AND
                            `params`.`Required` = 1
                        GROUP BY
                            `params`.`ID`
                        ORDER BY
                            `params`.`PostDate` ASC
                    )

UNION

(
                        SELECT
                            `param_texts`.`Title`,
                            `params`.`ID`,
                            GROUP_CONCAT(DISTINCT `PPV`.`ParamValue` SEPARATOR ',') AS `Values`
                        FROM
                            `products`
                            INNER JOIN `product_params` AS `PPV` ON `products`.`ID` = `PPV`.`ProductID`
                            INNER JOIN `params` ON `params`.`ID` = `PPV`.`ParamID`
                            INNER JOIN `param_texts` ON `params`.`ID` = `param_texts`.`ParamID`
                            
            INNER JOIN `product_params` AS `Param05` ON
                `Param05`.`ProductID` = `products`.`ID` AND
                `Param05`.`ParamID` = 5 AND
                `Param05`.`ParamValue` = '15'
            
                        WHERE
                            `products`.`Application` = 'P' AND
                            `products`.`Season` IN('S') AND
                            `params`.`ID` = 4 AND
                            `params`.`FilterType` = 1 AND
                            `params`.`Required` = 1
                        GROUP BY
                            `params`.`ID`
                        ORDER BY
                            `params`.`PostDate` ASC
                    )

UNION

(
                        SELECT
                            `param_texts`.`Title`,
                            `params`.`ID`,
                            GROUP_CONCAT(DISTINCT `PPV`.`ParamValue` SEPARATOR ',') AS `Values`
                        FROM
                            `products`
                            INNER JOIN `product_params` AS `PPV` ON `products`.`ID` = `PPV`.`ProductID`
                            INNER JOIN `params` ON `params`.`ID` = `PPV`.`ParamID`
                            INNER JOIN `param_texts` ON `params`.`ID` = `param_texts`.`ParamID`
                            
            INNER JOIN `product_params` AS `Param05` ON
                `Param05`.`ProductID` = `products`.`ID` AND
                `Param05`.`ParamID` = 5 AND
                `Param05`.`ParamValue` = '15'
            
                        WHERE
                            `products`.`Application` = 'P' AND
                            `products`.`Season` IN('S') AND
                            `params`.`ID` = 3 AND
                            `params`.`FilterType` = 1 AND
                            `params`.`Required` = 1
                        GROUP BY
                            `params`.`ID`
                        ORDER BY
                            `params`.`PostDate` ASC
                    )

SELECT
                `param_texts`.`Title`,
                `param_texts`.`Metric`,
                `params`.`FilterType`,
                `params`.`Prefix`
            FROM
                `params`
                INNER JOIN `param_texts` ON `params`.`ID` = `param_texts`.`ParamID`
            WHERE
                `params`.`ID` = 2 AND
                `params`.`FilterType` > 0 AND
                `params`.`Required` = 0
            GROUP BY
                `params`.`ID`
            LIMIT 1

SELECT
                `param_texts`.`Title`,
                `param_texts`.`Metric`,
                `params`.`FilterType`,
                `params`.`Prefix`
            FROM
                `params`
                INNER JOIN `param_texts` ON `params`.`ID` = `param_texts`.`ParamID`
            WHERE
                `params`.`ID` = 6 AND
                `params`.`FilterType` > 0 AND
                `params`.`Required` = 0
            GROUP BY
                `params`.`ID`
            LIMIT 1

SELECT
                `param_texts`.`Title`,
                `param_texts`.`Metric`,
                `params`.`FilterType`,
                `params`.`Prefix`
            FROM
                `params`
                INNER JOIN `param_texts` ON `params`.`ID` = `param_texts`.`ParamID`
            WHERE
                `params`.`ID` = 7 AND
                `params`.`FilterType` > 0 AND
                `params`.`Required` = 0
            GROUP BY
                `params`.`ID`
            LIMIT 1

SELECT
                `param_texts`.`Title`,
                `param_texts`.`Metric`,
                `params`.`FilterType`,
                `params`.`Prefix`
            FROM
                `params`
                INNER JOIN `param_texts` ON `params`.`ID` = `param_texts`.`ParamID`
            WHERE
                `params`.`ID` = 9 AND
                `params`.`FilterType` > 0 AND
                `params`.`Required` = 0
            GROUP BY
                `params`.`ID`
            LIMIT 1
# [15-Jul-2023 11:58:30] /unisex/root/bg/ajax/basket/qty.html?_=1689411511904 167.99.142.201

set names utf8

SELECT
                    `Qty`
                FROM
                    `basket`
                WHERE
                    `ClientID` = '4b4318f9d5c9cd9d82a13d321dda10a0e0e3cf7cd4b6ff527b8687a772a667bc'
                 LIMIT 1
# [15-Jul-2023 11:58:30] /unisex/root/bg/ajax/prices.html?_=1689411511910 167.99.142.201

set names utf8

SELECT
                `products`.`ID`,
                `prices`.`MonetaID`,
                `prices`.`UnitPrice` AS `Price`
            FROM
                `prices`
                INNER JOIN `products` ON `prices`.`MonetaID` = `products`.`MonetaID`
            WHERE
                `products`.`ID` IN ('4609','4486','4478','4475','4472','4449')
# [15-Jul-2023 11:58:30] /unisex/root/bg/ajax/prices.html?_=1689411511910 167.99.142.201

SELECT * FROM  fn_EShopItemInfo_New('MICHELIN 165/65 R15 81T PRIMACY4', 'EE1D040DB23B48A6B8712B899CBA8660', '00', '0');

SELECT * FROM  fn_EShopItemInfo_New('MICHELIN 195/50 R15 82V PRIMACY4', 'EE1D040DB23B48A6B8712B899CBA8660', '00', '0');

SELECT * FROM  fn_EShopItemInfo_New('MICHELIN 195/65 R15 95H PRIMACY4', 'EE1D040DB23B48A6B8712B899CBA8660', '00', '0');

SELECT * FROM  fn_EShopItemInfo_New('MICHELIN 205/65 R15 94H PRIMACY4', 'EE1D040DB23B48A6B8712B899CBA8660', '00', '0');

SELECT * FROM  fn_EShopItemInfo_New('MICHELIN 205/65 R15 94V PRIMACY4', 'EE1D040DB23B48A6B8712B899CBA8660', '00', '0');
