db_get_field(«SELECT productid FROM ?:products_categories WHERE productid=?i AND categoryid=?i », $productid, $cat);
$cat = isset($cat)? abs(intval($cat)): 0;
if ($cat > 0) {
func_query_first_cell(«SELECT productid FROM $sql_tbl[products_categories] WHERE productid='$productid' AND categoryid='$cat'»);
}
if (!empty($active_modules['Detailed_Product_Images']))
include $xcart_dir. '/modules/Detailed_Product_Images/product_images.php';
if (!empty($active_modules['Magnifier']))
include $xcart_dir. '/modules/Magnifier/product_magnifier.php';
(После подключения к базе важно не забыть установить кодировку mysqli_set_charset($mysql, "utf8mb4")).