Exception - get_dataset : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and (tex.`NAME` like '%i%')
)
order by
pro.PRIORITY' at line 80Array
(
[0] =>
select
SQL_CALC_FOUND_ROWS
pro.`ID`,
pro.`UNIT`,
pro.`PACKAGING`,
pro.`PACKAGING_UNIT`,
pro.`VOLUME_OF_COLLECTION`,
pro.`RATING_VALUE`,
pro.`REVIEW_COUNT`,
pro.`INSERTED`,
pro.`WHEN_THE_NEW_STATUS_EXPIRES`,
pro.`EQUAL_TO_ONE_HUNDRED_PERCENT`,
pro.`PACKAGING_DIVISABLE`,
pro.`VISIBLE`,
pro.`AVAILABLE`,
pro.`PRIORITY`,
pro.`IMAGES`,
pro.`INSTOCK`,
pro.`VATRATE`,
pro.`MARGIN_PERCENT`,
pro.`MARGIN_VALUE`,
pro.`DEFAULT_VARIATION`,
pro.`IS_PACKAGE`,
pro.`DISPLAY_TYPE`,
pro.`ISPRIMARY`,
case
when pro.`IS_PACKAGE` = 1 then (select count(*) from `product_package_items` as ppi inner join `products` as pro on pro.`ID` = ppi.`PRODUCT_ID` and pro.`INSTOCK` <= 0.000 where ppi.`PACKAGE_ID` = tex.PRODUCT_ID)
else 0
end as `CAN_NOT_BE_PURCHASED`,
pgp.`MARGIN_PERCENT` as `GROUP_MARGIN_PERCENT`,
pgp.`MARGIN_VALUE` as `GROUP_MARGIN_VALUE`,
man.`MARGIN_PERCENT` as `MANUFACTURER_MARGIN_PERCENT`,
man.`MARGIN_VALUE` as `MANUFACTURER_MARGIN_VALUE`,
tex.`NAME`,
tex.`TITLE`,
tex.`FOLDER`,
tex.`SHORT_DESCRIPTION`,
cpr.`NET` as NET_PRICE,
get_price(tex.PRODUCT_ID, 0) as CALC_PRICE,
cpr.`DISCOUNT_GRANTED`,
ppi.`PRODUCTID`,
pgt.`FOLDER` as GROUP_FOLDER,
pgt.`FOLDER` as GROUP_PATH,
uni.`SHORTNAME` as UNIT_NAME,
pni.`SHORTNAME` as PACKAGING_UNIT_NAME,
(select group_concat(concat(pic.ID, '|', pic.NAME, '|', pic.CLASS) order by find_in_set(pic.ID, pro.LEFT_PICTOGRAMS)) from pictograms as pic where find_in_set(pic.ID, pro.LEFT_PICTOGRAMS) order by find_in_set(pic.ID, pro.LEFT_PICTOGRAMS)) as LEFT_PICTOGRAM_LIST,
(select group_concat(concat(pic.ID, '|', pic.NAME, '|', pic.CLASS) order by find_in_set(pic.ID, pro.LEFT_PICTOGRAMS)) from pictograms as pic where find_in_set(pic.ID, pro.RIGHT_PICTOGRAMS) order by find_in_set(pic.ID, pro.LEFT_PICTOGRAMS)) as RIGHT_PICTOGRAM_LIST,
concat('[',(
select
group_concat(concat('{"vai":"',pva.`PRODUCT_VARIATION_ID`,'","vat":"',pva.`PRODUCT_VARIATION_TYPE`,'","nam":"',pvt.`NAME`,'","fol":"',pvt.`FOLDER`,'","typ":"',ppt.`TYPE`, '","val":"',ppi.`VALUE`,'","vlo":"',ppi.`VALUE_NUM_LOW`,'","vhi":"',ppi.`VALUE_NUM_HIGH`,'","dis":"',ifnull(cat.`VALUE`, ''),'","uni":"',ifnull(vun.`SHORTNAME`,''),'","img":"',vro.IMAGES,'"}'))
from
`product_variations` as pva
inner join `products_texts` as pvt on pvt.`PRODUCT_ID` = pva.`PRODUCT_VARIATION_ID` and pvt.`LANGUAGE` = 1
inner join `product_property_types` ppt on ppt.`ID` = pva.`PRODUCT_VARIATION_TYPE`
inner join `products` as vro on vro.`ID` = pva.`PRODUCT_VARIATION_ID`
left join `product_properties` as ppi on ppi.`PRODUCT_ID` = pva.`PRODUCT_VARIATION_ID` and ppi.`TYPE` = pva.`PRODUCT_VARIATION_TYPE`
left join `colors_and_textures` as cat on cat.`NAME` = ppi.`VALUE`
left join `units` as vun on vun.`UID` = ppt.`UNITID` and vun.`LANGUAGEID` = 1
where
pva.`PRODUCT_ID` = tex.`PRODUCT_ID`
),']') as VARIATIONS,
concat('{"vai":"',pro.`ID`,'","vat":"',pro.`DEFAULT_VARIATION`,'","nam":"',tex.`NAME`,'","fol":"',tex.`FOLDER`,'","typ":"',vart.`TYPE`, '","val":"',vapi.`VALUE`,'","vlo":"',vapi.`VALUE_NUM_LOW`,'","vhi":"',vapi.`VALUE_NUM_HIGH`,'","dis":"',ifnull(vcat.`VALUE`, ''),'","uni":"',ifnull(vaun.`SHORTNAME`,''),'","img":"',pro.IMAGES,'"}') as PRODUCT_VARIATION
from
products_texts as tex
inner join products as pro on pro.ID = tex.PRODUCT_ID and pro.`VISIBLE` = 1
inner join units as uni on uni.UID = pro.UNIT and uni.LANGUAGEID = 1
left join units as pni on pni.UID = pro.PACKAGING_UNIT and pni.LANGUAGEID = 1
inner join prices as cpr on cpr.PID = tex.PRODUCT_ID and cpr.TYPE = 3
inner join products_productids as ppi on ppi.PID = tex.PRODUCT_ID and VENDORID = 1
left join product_groups_texts as pgt on pgt.GROUP_ID = 99999 and pgt.LANGUAGE = 1
left join product_groups as pgp on pgp.ID = 99999
left join manufacturers as man on man.ID = pro.MANUFACTURER
left join `product_property_types` vart on vart.`ID` = pro.`DEFAULT_VARIATION`
left join `product_properties` as vapi on vapi.`PRODUCT_ID` = tex.`PRODUCT_ID` and vapi.`TYPE` = pro.`DEFAULT_VARIATION`
left join `colors_and_textures` as vcat on vcat.`NAME` = vapi.`VALUE`
left join `units` as vaun on vaun.`UID` = vart.`UNITID` and vaun.`LANGUAGEID` = 1
where
tex.LANGUAGE = 1
and ( and (tex.`NAME` like '%i%')
)
order by
pro.PRIORITY asc,
pro.BASE_DISCOUNT_PERCENT desc,
tex.NAME asc
limit
20
offset
0;
[1] => 1
)