Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
class ModelExtensionFeedMetaBase extends Model { public function getProduct($product_id, ..
Decoded Output download
<? class ModelExtensionFeedMetaBase extends Model { public function getProduct($product_id, $language_id, $store_id) { $query = $this->db->query("SELECT DISTINCT *, pd.name AS name, p.image, m.name AS manufacturer, (SELECT price FROM " . DB_PREFIX . "product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '" . (int) $this->config->get("config_customer_group_id") . "' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int) $this->config->get("config_customer_group_id") . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM " . DB_PREFIX . "product_reward pr WHERE pr.product_id = p.product_id AND pr.customer_group_id = '" . (int) $this->config->get("config_customer_group_id") . "') AS reward, (SELECT ss.name FROM " . DB_PREFIX . "stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '" . (int) $language_id . "') AS stock_status, (SELECT wcd.unit FROM " . DB_PREFIX . "weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '" . (int) $language_id . "') AS weight_class, (SELECT lcd.unit FROM " . DB_PREFIX . "length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '" . (int) $language_id . "') AS length_class, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '" . (int) $product_id . "' AND pd.language_id = '" . (int) $language_id . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int) $store_id . "'"); if ($query->num_rows) { $date_added = strval(date("YmdHms", strtotime($query->row["date_added"]))); $str_count = strlen($query->row["product_id"]); $gtin = substr($date_added, 0, 14 - $str_count) . $query->row["product_id"]; return array("product_id" => $query->row["product_id"], "name" => $query->row["name"], "description" => $query->row["description"], "quantity" => $query->row["quantity"], "stock_status" => $query->row["stock_status"], "image" => $query->row["image"], "manufacturer_id" => $query->row["manufacturer_id"], "manufacturer" => $query->row["manufacturer"], "price" => $query->row["discount"] ? $query->row["discount"] : $query->row["price"], "special" => $query->row["special"], "tax_class_id" => $query->row["tax_class_id"], "date_available" => $query->row["date_available"], "weight" => $query->row["weight"], "weight_class_id" => $query->row["weight_class_id"], "length" => $query->row["length"], "width" => $query->row["width"], "height" => $query->row["height"], "length_class_id" => $query->row["length_class_id"], "date_available" => $query->row["date_available"], "model" => $query->row["model"], "sku" => $query->row["sku"], "upc" => $query->row["upc"], "ean" => $query->row["ean"], "jan" => $query->row["jan"], "isbn" => $query->row["isbn"], "mpn" => $query->row["mpn"], "gtin" => $gtin); } else { return false; } } public function getProducts($data = array()) { $sql = "SELECT p.product_id, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT price FROM " . DB_PREFIX . "product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '" . (int) $this->config->get("config_customer_group_id") . "' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int) $this->config->get("config_customer_group_id") . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special"; if (!empty($data["filter_category_id"])) { if (!empty($data["filter_sub_category"])) { $sql .= " FROM " . DB_PREFIX . "category_path cp LEFT JOIN " . DB_PREFIX . "product_to_category p2c ON (cp.category_id = p2c.category_id)"; } else { $sql .= " FROM " . DB_PREFIX . "product_to_category p2c"; } if (!empty($data["filter_filter"])) { $sql .= " LEFT JOIN " . DB_PREFIX . "product_filter pf ON (p2c.product_id = pf.product_id) LEFT JOIN " . DB_PREFIX . "product p ON (pf.product_id = p.product_id)"; } else { $sql .= " LEFT JOIN " . DB_PREFIX . "product p ON (p2c.product_id = p.product_id)"; } } else { $sql .= " FROM " . DB_PREFIX . "product p"; } $sql .= " LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '" . (int) $data["language_id"] . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int) $data["store_id"] . "'"; if (!empty($data["filter_category_id"])) { if (!empty($data["filter_sub_category"])) { $sql .= " AND cp.path_id = '" . (int) $data["filter_category_id"] . "'"; } else { $sql .= " AND p2c.category_id = '" . (int) $data["filter_category_id"] . "'"; } if (!empty($data["filter_filter"])) { $implode = array(); $filters = explode(",", $data["filter_filter"]); foreach ($filters as $filter_id) { $implode[] = (int) $filter_id; } $sql .= " AND pf.filter_id IN (" . implode(",", $implode) . ")"; } } if (!empty($data["filter_name"]) || !empty($data["filter_tag"])) { $sql .= " AND ("; if (!empty($data["filter_name"])) { $implode = array(); $words = explode(" ", trim(preg_replace("/\s+/", " ", $data["filter_name"]))); foreach ($words as $word) { $implode[] = "pd.name LIKE '%" . $this->db->escape($word) . "%'"; } if ($implode) { $sql .= " " . implode(" AND ", $implode) . ''; } if (!empty($data["filter_description"])) { $sql .= " OR pd.description LIKE '%" . $this->db->escape($data["filter_name"]) . "%'"; } } if (!empty($data["filter_name"]) && !empty($data["filter_tag"])) { $sql .= " OR "; } if (!empty($data["filter_tag"])) { $implode = array(); $words = explode(" ", trim(preg_replace("/\s+/", " ", $data["filter_tag"]))); foreach ($words as $word) { $implode[] = "pd.tag LIKE '%" . $this->db->escape($word) . "%'"; } if ($implode) { $sql .= " " . implode(" AND ", $implode) . ''; } } if (!empty($data["filter_name"])) { $sql .= " OR LCASE(p.model) = '" . $this->db->escape(utf8_strtolower($data["filter_name"])) . "'"; $sql .= " OR LCASE(p.sku) = '" . $this->db->escape(utf8_strtolower($data["filter_name"])) . "'"; $sql .= " OR LCASE(p.upc) = '" . $this->db->escape(utf8_strtolower($data["filter_name"])) . "'"; $sql .= " OR LCASE(p.ean) = '" . $this->db->escape(utf8_strtolower($data["filter_name"])) . "'"; $sql .= " OR LCASE(p.jan) = '" . $this->db->escape(utf8_strtolower($data["filter_name"])) . "'"; $sql .= " OR LCASE(p.isbn) = '" . $this->db->escape(utf8_strtolower($data["filter_name"])) . "'"; $sql .= " OR LCASE(p.mpn) = '" . $this->db->escape(utf8_strtolower($data["filter_name"])) . "'"; } $sql .= ")"; } if (!empty($data["filter_manufacturer_id"])) { $sql .= " AND p.manufacturer_id = '" . (int) $data["filter_manufacturer_id"] . "'"; } $sql .= " GROUP BY p.product_id"; $sort_data = array("pd.name", "p.model", "p.quantity", "p.price", "rating", "p.sort_order", "p.date_added"); if (isset($data["sort"]) && in_array($data["sort"], $sort_data)) { if ($data["sort"] == "pd.name" || $data["sort"] == "p.model") { $sql .= " ORDER BY LCASE(" . $data["sort"] . ")"; } elseif ($data["sort"] == "p.price") { $sql .= " ORDER BY (CASE WHEN special IS NOT NULL THEN special WHEN discount IS NOT NULL THEN discount ELSE p.price END)"; } else { $sql .= " ORDER BY " . $data["sort"]; } } else { $sql .= " ORDER BY p.sort_order"; } if (isset($data["order"]) && $data["order"] == "DESC") { $sql .= " DESC, LCASE(pd.name) DESC"; } else { $sql .= " ASC, LCASE(pd.name) ASC"; } $product_data = array(); $query = $this->db->query($sql); foreach ($query->rows as $result) { $product_data[$result["product_id"]] = $this->getProduct($result["product_id"], $data["language_id"], $data["store_id"]); } return $product_data; } public function getProductAttributes($product_id, $language_id) { $product_attribute_group_data = array(); $product_attribute_group_query = $this->db->query("SELECT ag.attribute_group_id, agd.name FROM " . DB_PREFIX . "product_attribute pa LEFT JOIN " . DB_PREFIX . "attribute a ON (pa.attribute_id = a.attribute_id) LEFT JOIN " . DB_PREFIX . "attribute_group ag ON (a.attribute_group_id = ag.attribute_group_id) LEFT JOIN " . DB_PREFIX . "attribute_group_description agd ON (ag.attribute_group_id = agd.attribute_group_id) WHERE pa.product_id = '" . (int) $product_id . "' AND agd.language_id = '" . (int) $language_id . "' GROUP BY ag.attribute_group_id ORDER BY ag.sort_order, agd.name"); foreach ($product_attribute_group_query->rows as $product_attribute_group) { $product_attribute_data = array(); $product_attribute_query = $this->db->query("SELECT a.attribute_id, ad.name, pa.text FROM " . DB_PREFIX . "product_attribute pa LEFT JOIN " . DB_PREFIX . "attribute a ON (pa.attribute_id = a.attribute_id) LEFT JOIN " . DB_PREFIX . "attribute_description ad ON (a.attribute_id = ad.attribute_id) WHERE pa.product_id = '" . (int) $product_id . "' AND a.attribute_group_id = '" . (int) $product_attribute_group["attribute_group_id"] . "' AND ad.language_id = '" . (int) $language_id . "' AND pa.language_id = '" . (int) $language_id . "' ORDER BY a.sort_order, ad.name"); foreach ($product_attribute_query->rows as $product_attribute) { $product_attribute_data[] = array("name" => $product_attribute["name"], "text" => $product_attribute["text"]); } $product_attribute_group_data[] = array("name" => $product_attribute_group["name"], "attribute" => $product_attribute_data); } return $product_attribute_group_data; } public function getProductOptions($product_id) { $product_option_data = array(); $product_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option po LEFT JOIN `" . DB_PREFIX . "option` o ON (po.option_id = o.option_id) LEFT JOIN " . DB_PREFIX . "option_description od ON (o.option_id = od.option_id) WHERE po.product_id = '" . (int) $product_id . "' AND od.language_id = '" . (int) $this->config->get("config_language_id") . "' ORDER BY o.sort_order"); foreach ($product_option_query->rows as $product_option) { $product_option_value_data = array(); $product_option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option_value pov LEFT JOIN " . DB_PREFIX . "option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_id = '" . (int) $product_id . "' AND pov.product_option_id = '" . (int) $product_option["product_option_id"] . "' AND ovd.language_id = '" . (int) $this->config->get("config_language_id") . "' ORDER BY ov.sort_order"); foreach ($product_option_value_query->rows as $product_option_value) { $product_option_value_data[] = array("product_option_value_id" => $product_option_value["product_option_value_id"], "option_value_id" => $product_option_value["option_value_id"], "name" => $product_option_value["name"], "image" => $product_option_value["image"], "quantity" => $product_option_value["quantity"], "subtract" => $product_option_value["subtract"], "price" => $product_option_value["price"], "price_prefix" => $product_option_value["price_prefix"], "weight" => $product_option_value["weight"], "weight_prefix" => $product_option_value["weight_prefix"]); } $product_option_data[] = array("product_option_id" => $product_option["product_option_id"], "product_option_value" => $product_option_value_data, "option_id" => $product_option["option_id"], "name" => $product_option["name"], "type" => $product_option["type"], "value" => $product_option["value"], "required" => $product_option["required"]); } return $product_option_data; } public function getProductImages($product_id) { $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int) $product_id . "' ORDER BY sort_order ASC"); return $query->rows; } } ?>
Did this file decode correctly?
Original Code
class ModelExtensionFeedMetaBase extends Model { public function getProduct($product_id, $language_id, $store_id) { $query = $this->db->query("\x53\105\x4c\105\x43\x54\40\104\x49\x53\x54\111\x4e\x43\x54\x20\52\x2c\40\160\x64\x2e\x6e\141\x6d\x65\40\101\x53\x20\x6e\141\x6d\x65\x2c\40\x70\56\x69\x6d\x61\x67\145\x2c\40\155\56\x6e\x61\x6d\x65\x20\x41\123\x20\x6d\141\x6e\165\x66\x61\143\x74\165\162\x65\x72\54\x20\x28\123\105\x4c\x45\103\124\x20\160\x72\x69\143\145\x20\x46\122\117\x4d\40" . DB_PREFIX . "\160\x72\157\x64\165\143\x74\x5f\144\151\x73\143\x6f\x75\156\x74\40\160\x64\62\40\x57\x48\105\x52\x45\40\160\x64\62\x2e\x70\x72\x6f\144\165\x63\164\137\x69\144\40\x3d\x20\160\56\160\162\x6f\144\165\x63\164\x5f\151\144\40\101\x4e\104\x20\160\x64\x32\x2e\143\x75\x73\x74\x6f\155\145\x72\x5f\147\x72\x6f\x75\x70\137\151\144\x20\x3d\x20\47" . (int) $this->config->get("\x63\x6f\x6e\146\151\147\x5f\143\x75\x73\164\x6f\x6d\x65\162\137\147\162\157\165\160\x5f\151\144") . "\x27\40\x41\116\x44\x20\160\x64\62\x2e\x71\x75\141\x6e\164\x69\164\171\40\x3d\x20\x27\61\x27\40\x41\116\104\x20\x28\x28\160\x64\62\x2e\x64\x61\x74\145\x5f\163\x74\141\162\164\40\75\40\x27\x30\60\60\x30\55\60\60\x2d\x30\x30\47\x20\117\x52\40\160\144\62\x2e\x64\x61\164\145\137\163\164\x61\x72\164\40\74\x20\116\117\x57\x28\51\51\40\101\x4e\104\40\x28\160\144\x32\56\x64\x61\x74\145\137\x65\156\144\x20\75\40\47\60\60\60\60\55\x30\x30\x2d\60\60\47\x20\x4f\x52\40\160\144\x32\x2e\x64\141\x74\145\137\145\156\x64\40\76\x20\116\x4f\127\x28\51\51\51\40\117\x52\104\x45\x52\x20\x42\x59\40\160\x64\x32\56\160\162\x69\157\162\151\x74\x79\40\x41\x53\x43\x2c\40\160\x64\62\56\160\162\151\x63\x65\x20\x41\123\103\x20\x4c\111\115\111\x54\40\61\51\40\101\123\x20\x64\x69\163\143\x6f\x75\156\x74\54\x20\x28\x53\x45\x4c\x45\103\124\x20\x70\162\x69\143\145\40\x46\122\x4f\115\40" . DB_PREFIX . "\x70\162\157\144\165\143\164\137\163\160\x65\x63\151\141\154\40\x70\x73\40\127\x48\x45\122\x45\x20\160\163\x2e\160\x72\x6f\x64\165\x63\x74\x5f\x69\144\40\x3d\40\x70\x2e\160\162\x6f\144\x75\143\x74\137\151\144\x20\x41\x4e\x44\x20\x70\x73\x2e\143\x75\x73\x74\x6f\155\x65\x72\137\147\x72\157\165\x70\137\151\144\x20\75\40\47" . (int) $this->config->get("\143\157\x6e\x66\151\x67\x5f\143\165\163\164\157\x6d\145\162\137\x67\x72\x6f\165\160\x5f\x69\x64") . "\x27\40\x41\x4e\104\x20\50\x28\160\x73\x2e\144\x61\x74\x65\137\163\164\x61\162\x74\40\x3d\40\47\x30\60\x30\x30\x2d\x30\60\x2d\x30\x30\x27\40\117\x52\40\x70\163\56\x64\141\x74\x65\x5f\x73\164\x61\x72\x74\40\74\40\116\117\127\50\51\x29\x20\x41\116\x44\40\x28\160\163\56\144\141\164\145\137\145\x6e\144\x20\75\x20\47\x30\60\x30\x30\55\60\60\55\x30\x30\47\x20\x4f\122\40\x70\163\56\144\x61\164\x65\137\145\156\x64\40\76\x20\116\x4f\x57\50\x29\51\x29\40\117\122\104\x45\122\40\102\x59\40\x70\163\x2e\160\x72\x69\157\162\151\x74\171\x20\x41\x53\103\54\x20\x70\163\56\160\x72\x69\x63\x65\40\x41\123\103\x20\114\x49\x4d\111\x54\40\61\x29\40\x41\x53\x20\163\160\x65\x63\x69\x61\154\x2c\x20\50\123\x45\x4c\105\x43\124\40\160\x6f\151\156\x74\x73\40\106\122\x4f\115\40" . DB_PREFIX . "\x70\162\x6f\144\x75\x63\164\137\162\x65\167\x61\162\144\40\160\162\40\127\x48\105\x52\105\40\160\162\x2e\160\162\x6f\x64\165\x63\164\137\151\x64\x20\x3d\x20\160\56\160\162\157\x64\165\143\x74\137\151\144\40\x41\x4e\x44\x20\x70\162\x2e\x63\x75\163\x74\x6f\155\x65\162\x5f\147\162\x6f\x75\x70\x5f\x69\144\40\x3d\x20\47" . (int) $this->config->get("\x63\157\x6e\x66\x69\147\137\x63\165\x73\x74\157\x6d\145\x72\137\147\x72\x6f\165\160\x5f\151\144") . "\47\x29\x20\101\x53\x20\162\145\x77\x61\x72\144\54\x20\x28\123\105\114\x45\103\x54\40\163\x73\56\x6e\x61\x6d\x65\x20\106\122\x4f\115\x20" . DB_PREFIX . "\x73\164\x6f\143\x6b\137\x73\164\x61\164\165\163\x20\163\163\40\127\110\105\x52\105\40\163\x73\56\163\164\x6f\143\153\x5f\163\164\x61\164\165\163\x5f\x69\x64\x20\75\x20\x70\x2e\163\x74\157\143\153\137\163\x74\x61\x74\165\163\137\x69\x64\x20\101\116\x44\x20\x73\x73\56\x6c\x61\x6e\x67\x75\141\x67\145\137\151\x64\x20\75\x20\x27" . (int) $language_id . "\47\x29\x20\x41\123\x20\163\x74\x6f\143\x6b\x5f\x73\164\141\164\x75\x73\54\40\50\x53\105\x4c\x45\103\124\40\167\143\144\56\x75\156\x69\x74\40\106\122\x4f\115\x20" . DB_PREFIX . "\167\145\151\147\x68\x74\x5f\x63\154\141\x73\x73\x5f\x64\x65\163\x63\x72\x69\x70\x74\x69\157\156\x20\167\x63\x64\x20\127\110\x45\x52\x45\x20\x70\56\x77\x65\151\x67\150\x74\137\143\154\x61\x73\163\x5f\x69\144\x20\x3d\40\167\x63\x64\56\x77\x65\x69\x67\x68\x74\x5f\x63\x6c\141\x73\163\137\151\144\x20\101\x4e\104\40\x77\143\x64\x2e\154\141\x6e\147\x75\x61\x67\x65\x5f\151\x64\40\x3d\40\47" . (int) $language_id . "\47\51\40\101\123\x20\167\145\x69\x67\150\x74\x5f\x63\154\141\163\163\x2c\40\x28\x53\x45\x4c\x45\103\x54\40\x6c\x63\x64\x2e\165\x6e\x69\x74\40\x46\x52\x4f\x4d\40" . DB_PREFIX . "\154\145\x6e\147\x74\150\x5f\143\154\141\x73\163\x5f\144\145\x73\x63\x72\151\160\164\x69\x6f\156\40\x6c\143\144\x20\x57\110\105\122\105\x20\160\56\154\x65\156\147\x74\150\x5f\143\x6c\x61\163\163\137\x69\x64\x20\x3d\x20\154\x63\x64\56\154\x65\156\147\x74\150\137\143\154\x61\163\x73\x5f\151\x64\x20\x41\x4e\104\40\154\143\x64\56\154\141\x6e\147\165\x61\x67\145\x5f\151\x64\40\75\x20\47" . (int) $language_id . "\47\x29\40\x41\123\x20\154\x65\156\x67\164\x68\x5f\143\154\141\x73\163\54\x20\x28\123\x45\x4c\x45\103\124\x20\x41\x56\x47\x28\162\x61\164\x69\x6e\x67\51\x20\101\x53\x20\164\x6f\164\x61\154\40\x46\x52\x4f\115\x20" . DB_PREFIX . "\162\145\166\x69\x65\167\x20\162\61\x20\x57\110\x45\122\105\x20\162\61\x2e\160\x72\x6f\x64\165\143\x74\137\x69\144\40\75\x20\x70\x2e\x70\162\x6f\x64\165\143\164\137\151\x64\x20\x41\x4e\x44\x20\x72\x31\56\x73\x74\141\x74\x75\x73\40\75\40\x27\x31\x27\40\x47\122\117\x55\x50\40\102\131\40\162\61\56\160\162\157\144\x75\143\164\137\151\144\51\40\101\x53\x20\x72\141\x74\151\x6e\x67\x2c\40\50\x53\x45\114\105\x43\124\40\x43\x4f\x55\116\x54\x28\x2a\x29\x20\101\123\x20\164\157\x74\141\154\x20\106\122\117\x4d\x20" . DB_PREFIX . "\162\145\x76\151\145\167\x20\162\x32\40\127\110\105\x52\105\40\162\62\x2e\x70\x72\157\x64\165\143\x74\x5f\x69\144\40\75\40\x70\56\x70\162\x6f\x64\x75\x63\x74\137\x69\144\40\101\x4e\104\x20\x72\62\56\163\164\141\x74\x75\163\40\75\x20\47\61\x27\x20\107\x52\117\125\120\x20\x42\x59\x20\162\62\56\160\162\157\144\x75\x63\x74\137\x69\x64\x29\40\101\123\40\162\145\166\151\145\167\163\54\x20\160\x2e\163\x6f\x72\x74\137\x6f\162\144\x65\x72\40\106\122\x4f\115\x20" . DB_PREFIX . "\160\x72\157\144\165\x63\164\40\160\40\x4c\105\x46\124\x20\x4a\x4f\111\116\40" . DB_PREFIX . "\x70\162\157\x64\x75\x63\x74\137\144\x65\163\143\162\x69\x70\164\x69\x6f\156\40\160\x64\x20\x4f\116\x20\50\160\x2e\x70\x72\x6f\144\x75\x63\x74\x5f\x69\144\x20\x3d\40\x70\144\56\160\x72\157\x64\165\x63\164\137\x69\144\x29\x20\114\x45\106\124\x20\112\117\111\x4e\40" . DB_PREFIX . "\160\x72\x6f\x64\165\x63\x74\137\x74\x6f\137\x73\164\x6f\x72\145\40\x70\62\x73\x20\x4f\116\x20\x28\x70\x2e\160\162\x6f\144\x75\143\x74\x5f\x69\x64\x20\x3d\40\160\x32\163\56\x70\x72\157\x64\x75\x63\x74\137\x69\x64\51\x20\x4c\x45\x46\124\40\112\117\111\x4e\x20" . DB_PREFIX . "\x6d\x61\156\x75\x66\141\143\164\x75\162\x65\162\40\155\40\117\x4e\40\x28\x70\x2e\155\x61\156\x75\146\x61\x63\x74\x75\162\145\162\x5f\x69\x64\40\75\40\155\x2e\155\x61\156\x75\146\x61\143\x74\x75\x72\145\162\137\x69\x64\x29\40\x57\110\x45\122\105\x20\160\56\160\162\x6f\x64\x75\143\164\x5f\x69\x64\40\x3d\x20\x27" . (int) $product_id . "\x27\40\x41\116\x44\x20\x70\144\56\x6c\x61\156\147\165\141\147\145\x5f\151\x64\x20\x3d\40\47" . (int) $language_id . "\47\x20\101\x4e\104\40\160\56\x73\164\x61\x74\x75\163\40\x3d\40\x27\x31\47\x20\101\x4e\x44\x20\x70\56\x64\x61\164\145\137\x61\x76\x61\151\x6c\141\x62\154\145\x20\x3c\75\40\x4e\117\127\50\51\40\101\x4e\x44\x20\160\62\163\56\x73\164\x6f\x72\x65\137\x69\144\x20\75\x20\47" . (int) $store_id . "\47"); if ($query->num_rows) { $date_added = strval(date("\x59\x6d\144\110\155\163", strtotime($query->row["\x64\141\164\x65\x5f\141\x64\144\145\x64"]))); $str_count = strlen($query->row["\160\162\x6f\x64\x75\x63\x74\137\151\144"]); $gtin = substr($date_added, 0, 14 - $str_count) . $query->row["\x70\x72\157\x64\165\143\x74\x5f\x69\144"]; return array("\x70\x72\x6f\x64\165\143\x74\x5f\x69\x64" => $query->row["\160\162\x6f\144\x75\143\x74\137\151\144"], "\156\141\155\x65" => $query->row["\156\x61\155\x65"], "\x64\x65\x73\x63\162\x69\160\x74\151\x6f\x6e" => $query->row["\x64\145\x73\143\162\x69\160\x74\151\157\156"], "\161\165\x61\156\x74\x69\x74\171" => $query->row["\161\x75\141\x6e\164\x69\x74\x79"], "\x73\164\x6f\x63\x6b\137\x73\164\141\x74\x75\x73" => $query->row["\x73\164\157\143\153\x5f\x73\x74\141\164\165\x73"], "\x69\x6d\x61\x67\x65" => $query->row["\x69\x6d\141\147\x65"], "\x6d\141\x6e\165\x66\141\x63\x74\x75\162\145\162\x5f\151\144" => $query->row["\155\x61\156\x75\x66\141\x63\164\x75\162\x65\x72\137\151\x64"], "\155\141\156\165\x66\x61\x63\x74\165\162\x65\162" => $query->row["\155\141\156\x75\x66\x61\x63\x74\165\x72\145\162"], "\x70\162\151\143\x65" => $query->row["\144\151\x73\x63\x6f\165\156\x74"] ? $query->row["\144\x69\x73\x63\157\x75\x6e\x74"] : $query->row["\x70\162\x69\x63\x65"], "\163\160\x65\143\151\x61\x6c" => $query->row["\x73\160\145\x63\151\141\x6c"], "\164\141\170\x5f\x63\154\x61\163\163\137\151\x64" => $query->row["\164\x61\170\137\x63\x6c\141\x73\163\137\151\x64"], "\144\141\x74\145\137\141\166\141\x69\x6c\x61\x62\154\x65" => $query->row["\144\141\164\x65\137\141\166\141\x69\x6c\141\x62\154\x65"], "\x77\145\151\x67\150\164" => $query->row["\167\x65\151\x67\x68\x74"], "\x77\x65\x69\x67\150\x74\x5f\143\x6c\141\163\x73\x5f\151\144" => $query->row["\167\x65\151\x67\150\164\x5f\x63\x6c\x61\163\163\137\x69\x64"], "\154\x65\x6e\147\164\150" => $query->row["\154\x65\x6e\x67\x74\150"], "\x77\x69\144\164\x68" => $query->row["\x77\151\x64\x74\150"], "\x68\x65\151\147\x68\164" => $query->row["\150\145\x69\147\150\164"], "\x6c\145\156\x67\164\x68\137\x63\154\x61\x73\163\137\x69\144" => $query->row["\x6c\x65\x6e\x67\164\x68\137\143\x6c\141\163\163\x5f\x69\144"], "\144\x61\x74\x65\137\x61\x76\x61\151\x6c\141\142\x6c\x65" => $query->row["\144\x61\x74\x65\137\141\x76\x61\x69\x6c\141\x62\x6c\145"], "\x6d\157\144\x65\154" => $query->row["\x6d\x6f\x64\x65\154"], "\x73\153\165" => $query->row["\163\153\165"], "\165\160\143" => $query->row["\165\160\143"], "\145\x61\156" => $query->row["\145\x61\156"], "\152\x61\x6e" => $query->row["\x6a\141\156"], "\151\x73\x62\x6e" => $query->row["\151\163\x62\156"], "\155\x70\x6e" => $query->row["\x6d\x70\156"], "\147\x74\x69\156" => $gtin); } else { return false; } } public function getProducts($data = array()) { $sql = "\x53\x45\114\x45\103\x54\40\160\56\160\162\157\x64\165\143\x74\x5f\151\x64\54\40\x28\x53\105\114\105\x43\x54\40\101\x56\x47\x28\162\141\164\151\x6e\x67\51\40\101\123\x20\x74\x6f\x74\x61\x6c\x20\106\x52\117\x4d\x20" . DB_PREFIX . "\162\x65\166\x69\145\x77\40\x72\x31\x20\127\x48\x45\x52\105\x20\x72\x31\x2e\x70\x72\157\x64\165\143\x74\137\151\144\40\x3d\x20\x70\x2e\160\162\x6f\144\x75\x63\x74\137\151\144\x20\101\116\x44\40\162\61\56\163\164\x61\164\x75\163\x20\x3d\x20\x27\61\47\x20\x47\x52\117\x55\x50\x20\102\x59\x20\x72\x31\56\160\x72\x6f\144\165\x63\164\x5f\151\144\x29\40\101\x53\x20\x72\x61\x74\x69\156\x67\x2c\40\x28\123\x45\114\105\x43\x54\x20\160\162\151\143\x65\40\x46\122\117\x4d\x20" . DB_PREFIX . "\x70\x72\157\144\165\143\x74\137\x64\151\x73\x63\157\165\x6e\x74\40\x70\144\62\x20\127\110\105\x52\x45\40\x70\x64\62\x2e\x70\x72\x6f\x64\x75\x63\x74\x5f\151\144\40\x3d\40\160\56\x70\162\x6f\144\x75\143\164\x5f\151\144\40\x41\116\x44\40\160\144\62\56\143\165\x73\164\x6f\x6d\x65\x72\x5f\x67\162\x6f\165\160\137\x69\144\x20\x3d\40\47" . (int) $this->config->get("\143\157\156\146\151\147\137\x63\165\163\164\157\x6d\145\162\x5f\x67\162\x6f\x75\x70\137\x69\144") . "\47\40\101\x4e\x44\40\160\144\x32\56\x71\x75\141\156\x74\151\164\171\x20\75\40\x27\61\x27\x20\x41\x4e\x44\40\50\50\x70\144\x32\x2e\x64\x61\x74\145\137\163\x74\x61\162\164\x20\x3d\x20\x27\60\60\60\x30\55\x30\x30\x2d\x30\60\47\40\x4f\x52\x20\160\x64\62\56\144\141\164\x65\137\163\164\x61\162\x74\40\x3c\x20\x4e\x4f\x57\x28\x29\51\40\x41\x4e\x44\x20\50\x70\x64\x32\56\x64\141\x74\145\137\145\x6e\144\40\x3d\x20\x27\x30\x30\x30\60\55\60\x30\x2d\60\60\x27\x20\x4f\122\40\160\144\62\x2e\x64\x61\x74\145\137\x65\156\x64\40\x3e\40\x4e\117\127\x28\x29\51\x29\40\x4f\122\x44\x45\122\40\x42\x59\x20\x70\144\x32\x2e\160\x72\151\x6f\162\151\x74\171\x20\101\123\103\x2c\40\x70\x64\62\56\160\162\x69\x63\145\40\101\x53\x43\x20\x4c\x49\115\111\124\x20\61\51\x20\101\x53\40\144\151\x73\143\157\x75\x6e\x74\x2c\x20\x28\x53\x45\x4c\105\x43\x54\40\160\x72\x69\x63\145\x20\x46\122\117\115\40" . DB_PREFIX . "\160\x72\x6f\x64\165\x63\164\137\163\x70\x65\143\x69\141\x6c\x20\x70\163\40\x57\110\x45\x52\x45\40\x70\x73\56\160\162\x6f\144\165\143\x74\137\x69\144\x20\75\40\x70\x2e\160\162\x6f\144\165\143\x74\x5f\151\144\x20\x41\116\104\x20\160\163\x2e\x63\x75\163\x74\157\155\x65\162\x5f\147\x72\x6f\x75\160\x5f\x69\x64\40\75\x20\x27" . (int) $this->config->get("\x63\157\x6e\x66\x69\147\137\x63\165\163\x74\x6f\x6d\145\162\x5f\x67\x72\157\165\x70\x5f\151\x64") . "\47\x20\101\116\x44\x20\x28\50\x70\163\56\144\141\164\145\x5f\163\x74\x61\x72\164\x20\75\x20\x27\60\x30\60\x30\x2d\x30\x30\x2d\x30\60\47\40\117\x52\40\x70\163\56\x64\x61\x74\x65\137\163\164\141\162\x74\40\x3c\40\116\117\x57\x28\51\51\40\x41\116\104\x20\x28\160\163\56\x64\141\164\x65\137\145\156\144\40\75\x20\x27\60\60\60\x30\55\60\60\55\x30\60\47\x20\117\122\40\160\x73\56\144\141\x74\145\137\145\x6e\144\40\x3e\40\116\x4f\127\50\51\x29\51\x20\117\122\104\x45\x52\x20\x42\x59\x20\x70\163\x2e\160\162\151\157\x72\151\164\x79\x20\x41\123\103\x2c\40\160\x73\56\x70\x72\x69\143\145\x20\x41\123\103\x20\x4c\x49\x4d\111\x54\x20\x31\x29\40\x41\x53\40\x73\160\x65\x63\151\x61\154"; if (!empty($data["\146\151\154\x74\145\162\137\x63\x61\164\x65\147\157\162\171\137\x69\x64"])) { if (!empty($data["\146\151\x6c\x74\145\162\137\163\165\142\137\143\141\164\145\147\157\x72\171"])) { $sql .= "\40\x46\122\117\115\x20" . DB_PREFIX . "\x63\141\164\x65\x67\157\162\171\x5f\160\141\164\x68\40\x63\160\40\114\x45\106\124\40\x4a\x4f\x49\116\40" . DB_PREFIX . "\x70\162\x6f\144\x75\x63\x74\x5f\164\x6f\x5f\143\x61\x74\145\147\x6f\x72\x79\x20\160\62\143\x20\x4f\x4e\x20\x28\143\160\x2e\x63\141\164\145\147\x6f\x72\x79\137\x69\x64\40\x3d\x20\x70\62\x63\56\143\x61\164\x65\147\157\162\171\x5f\151\144\x29"; } else { $sql .= "\40\x46\122\117\115\40" . DB_PREFIX . "\x70\162\x6f\x64\x75\143\x74\137\x74\157\137\143\141\164\x65\x67\x6f\162\x79\x20\x70\62\143"; } if (!empty($data["\x66\151\154\x74\145\162\137\x66\x69\154\x74\145\162"])) { $sql .= "\40\x4c\105\106\x54\x20\112\117\x49\116\x20" . DB_PREFIX . "\160\x72\157\144\165\143\x74\137\146\151\x6c\x74\145\x72\40\x70\146\x20\x4f\x4e\x20\x28\x70\62\x63\56\160\162\157\x64\165\143\x74\137\151\144\40\x3d\x20\x70\x66\56\160\x72\x6f\144\x75\143\164\x5f\151\x64\51\40\x4c\x45\x46\x54\x20\x4a\x4f\x49\116\x20" . DB_PREFIX . "\160\x72\x6f\144\165\x63\164\40\x70\x20\x4f\x4e\40\50\160\x66\x2e\x70\x72\157\x64\165\143\164\x5f\x69\144\40\75\x20\160\x2e\160\162\x6f\x64\165\143\x74\137\x69\x64\51"; } else { $sql .= "\40\x4c\x45\x46\x54\40\112\x4f\111\x4e\x20" . DB_PREFIX . "\160\162\x6f\x64\x75\143\164\x20\160\40\117\116\x20\50\x70\62\x63\x2e\x70\x72\157\x64\x75\x63\164\x5f\x69\x64\40\75\x20\x70\x2e\160\162\x6f\x64\x75\143\x74\137\x69\x64\51"; } } else { $sql .= "\40\x46\x52\117\115\x20" . DB_PREFIX . "\160\162\157\144\165\143\164\x20\160"; } $sql .= "\x20\x4c\105\x46\x54\x20\x4a\117\111\116\x20" . DB_PREFIX . "\160\162\157\x64\165\143\x74\137\x64\145\163\143\x72\151\160\164\x69\157\156\40\x70\x64\x20\117\116\x20\x28\x70\x2e\x70\162\157\144\165\143\164\137\x69\x64\x20\x3d\x20\160\144\x2e\160\162\x6f\x64\x75\x63\x74\x5f\x69\144\51\x20\x4c\105\106\x54\40\x4a\117\x49\116\x20" . DB_PREFIX . "\x70\x72\x6f\144\165\x63\164\137\x74\x6f\x5f\163\164\x6f\x72\x65\x20\160\62\x73\40\x4f\116\x20\50\160\x2e\x70\162\157\x64\165\143\164\137\151\144\x20\75\40\160\62\163\x2e\x70\162\157\144\165\x63\164\x5f\x69\144\51\40\x57\x48\x45\122\x45\40\160\x64\56\154\x61\x6e\x67\x75\141\147\x65\137\151\x64\x20\x3d\40\47" . (int) $data["\154\x61\156\x67\165\141\x67\x65\x5f\151\144"] . "\x27\x20\x41\x4e\x44\x20\x70\56\163\x74\141\164\165\x73\x20\x3d\x20\47\61\47\x20\101\116\104\x20\160\x2e\144\141\x74\145\x5f\141\x76\141\151\x6c\x61\x62\x6c\145\40\x3c\x3d\x20\x4e\x4f\127\50\x29\40\101\116\x44\x20\x70\x32\x73\x2e\x73\164\x6f\x72\x65\x5f\151\x64\x20\75\40\47" . (int) $data["\x73\x74\x6f\x72\x65\137\x69\x64"] . "\x27"; if (!empty($data["\x66\151\x6c\x74\145\162\137\143\141\164\145\x67\x6f\x72\171\x5f\x69\x64"])) { if (!empty($data["\146\x69\154\164\x65\162\x5f\163\x75\142\x5f\143\x61\x74\145\147\x6f\162\171"])) { $sql .= "\40\101\116\x44\40\143\160\56\x70\141\x74\150\x5f\x69\144\40\x3d\40\x27" . (int) $data["\146\151\154\164\145\162\x5f\x63\x61\x74\145\x67\x6f\162\x79\137\151\x64"] . "\x27"; } else { $sql .= "\40\x41\116\104\x20\x70\62\143\56\x63\x61\164\145\x67\157\162\x79\x5f\151\x64\x20\x3d\40\47" . (int) $data["\146\151\154\164\x65\162\137\x63\141\x74\145\147\x6f\x72\x79\x5f\x69\x64"] . "\47"; } if (!empty($data["\146\151\x6c\164\145\162\x5f\146\151\154\164\x65\162"])) { $implode = array(); $filters = explode("\x2c", $data["\146\x69\x6c\x74\x65\x72\x5f\x66\151\x6c\164\x65\162"]); foreach ($filters as $filter_id) { $implode[] = (int) $filter_id; } $sql .= "\x20\101\x4e\104\x20\x70\x66\56\x66\151\x6c\x74\x65\x72\x5f\x69\x64\40\111\x4e\40\50" . implode("\54", $implode) . "\x29"; } } if (!empty($data["\146\151\154\x74\x65\x72\x5f\x6e\x61\155\145"]) || !empty($data["\x66\151\154\164\145\x72\137\164\x61\x67"])) { $sql .= "\x20\x41\x4e\x44\40\50"; if (!empty($data["\146\151\x6c\x74\145\x72\x5f\156\141\x6d\145"])) { $implode = array(); $words = explode("\x20", trim(preg_replace("\57\x5c\x73\x2b\x2f", "\x20", $data["\146\x69\x6c\164\145\162\x5f\x6e\141\155\145"]))); foreach ($words as $word) { $implode[] = "\160\144\56\156\x61\x6d\x65\40\x4c\111\113\105\40\47\45" . $this->db->escape($word) . "\x25\x27"; } if ($implode) { $sql .= "\40" . implode("\40\x41\116\x44\40", $implode) . ''; } if (!empty($data["\146\x69\154\x74\x65\162\137\x64\145\x73\143\162\x69\x70\x74\x69\x6f\156"])) { $sql .= "\x20\117\122\40\x70\144\x2e\144\145\x73\x63\x72\151\x70\164\151\157\156\40\114\111\113\x45\40\47\45" . $this->db->escape($data["\x66\x69\154\x74\x65\x72\x5f\156\141\x6d\x65"]) . "\x25\x27"; } } if (!empty($data["\146\x69\154\x74\x65\x72\137\156\x61\155\x65"]) && !empty($data["\146\151\x6c\164\145\x72\x5f\164\141\x67"])) { $sql .= "\40\117\x52\40"; } if (!empty($data["\x66\x69\x6c\x74\145\x72\x5f\164\x61\x67"])) { $implode = array(); $words = explode("\x20", trim(preg_replace("\57\x5c\163\53\57", "\x20", $data["\x66\151\154\x74\x65\x72\137\x74\x61\147"]))); foreach ($words as $word) { $implode[] = "\160\x64\x2e\x74\x61\x67\40\114\x49\113\x45\40\47\45" . $this->db->escape($word) . "\45\47"; } if ($implode) { $sql .= "\40" . implode("\40\101\x4e\104\40", $implode) . ''; } } if (!empty($data["\146\151\154\164\x65\x72\x5f\x6e\x61\x6d\x65"])) { $sql .= "\x20\117\122\40\114\103\x41\123\105\50\x70\56\155\x6f\144\x65\154\51\x20\75\x20\x27" . $this->db->escape(utf8_strtolower($data["\146\151\154\x74\145\162\137\156\x61\155\145"])) . "\47"; $sql .= "\40\x4f\122\x20\114\103\x41\x53\x45\50\x70\x2e\163\153\165\x29\40\x3d\40\x27" . $this->db->escape(utf8_strtolower($data["\x66\151\154\x74\145\x72\137\156\141\155\145"])) . "\x27"; $sql .= "\40\117\122\x20\x4c\103\101\x53\105\x28\x70\x2e\165\160\143\51\x20\x3d\x20\47" . $this->db->escape(utf8_strtolower($data["\x66\x69\154\x74\x65\x72\137\x6e\141\155\145"])) . "\47"; $sql .= "\40\x4f\x52\x20\x4c\x43\x41\123\x45\x28\x70\56\x65\141\x6e\x29\x20\x3d\40\47" . $this->db->escape(utf8_strtolower($data["\x66\151\154\164\145\x72\137\156\141\x6d\x65"])) . "\47"; $sql .= "\x20\117\x52\x20\x4c\103\x41\123\x45\50\x70\x2e\x6a\x61\156\51\x20\75\x20\x27" . $this->db->escape(utf8_strtolower($data["\146\151\154\164\145\162\137\156\x61\x6d\145"])) . "\47"; $sql .= "\x20\117\x52\x20\x4c\103\x41\x53\x45\50\x70\56\151\x73\x62\156\x29\40\x3d\x20\47" . $this->db->escape(utf8_strtolower($data["\x66\151\154\x74\145\x72\137\156\141\x6d\x65"])) . "\47"; $sql .= "\40\117\122\40\114\103\x41\123\x45\x28\x70\56\155\160\156\51\x20\75\40\47" . $this->db->escape(utf8_strtolower($data["\146\x69\x6c\164\x65\162\x5f\x6e\141\155\145"])) . "\47"; } $sql .= "\x29"; } if (!empty($data["\146\x69\154\164\x65\x72\x5f\x6d\141\156\x75\x66\141\x63\x74\x75\162\x65\162\x5f\x69\x64"])) { $sql .= "\40\101\x4e\x44\x20\160\56\x6d\x61\x6e\x75\x66\x61\x63\164\165\x72\x65\162\137\151\144\40\x3d\40\47" . (int) $data["\146\151\x6c\164\x65\162\x5f\155\141\156\165\x66\141\x63\164\165\x72\145\x72\x5f\x69\144"] . "\47"; } $sql .= "\40\107\122\117\x55\x50\x20\x42\x59\x20\x70\x2e\160\162\157\x64\x75\143\x74\x5f\151\x64"; $sort_data = array("\160\x64\56\156\x61\x6d\x65", "\160\x2e\x6d\x6f\144\145\x6c", "\x70\x2e\161\x75\x61\x6e\x74\151\164\x79", "\x70\56\x70\162\x69\x63\x65", "\x72\x61\x74\151\x6e\147", "\x70\56\x73\157\x72\164\137\157\162\x64\x65\x72", "\160\x2e\x64\x61\x74\x65\x5f\x61\144\x64\145\144"); if (isset($data["\163\157\x72\164"]) && in_array($data["\163\157\x72\x74"], $sort_data)) { if ($data["\x73\x6f\x72\164"] == "\160\144\56\156\141\155\x65" || $data["\163\x6f\162\164"] == "\x70\x2e\x6d\x6f\x64\x65\154") { $sql .= "\40\117\x52\x44\x45\x52\40\x42\x59\40\114\103\101\123\x45\x28" . $data["\x73\x6f\x72\x74"] . "\51"; } elseif ($data["\x73\157\162\x74"] == "\160\x2e\x70\162\151\x63\145") { $sql .= "\x20\x4f\x52\104\105\122\40\x42\131\40\x28\x43\x41\123\x45\x20\x57\x48\x45\x4e\x20\163\160\145\x63\x69\141\154\x20\x49\123\x20\x4e\x4f\124\x20\116\x55\x4c\114\40\x54\x48\105\x4e\40\x73\160\x65\143\151\x61\x6c\x20\x57\110\105\x4e\40\x64\151\x73\143\x6f\x75\x6e\164\40\x49\123\x20\x4e\117\124\x20\116\x55\x4c\x4c\40\x54\110\105\116\x20\144\x69\x73\143\x6f\165\156\164\x20\x45\x4c\123\x45\x20\160\x2e\160\x72\x69\x63\x65\x20\x45\116\104\51"; } else { $sql .= "\40\117\x52\x44\105\x52\x20\x42\131\x20" . $data["\163\157\162\x74"]; } } else { $sql .= "\x20\117\x52\104\x45\122\x20\x42\x59\x20\160\56\x73\x6f\x72\x74\137\157\162\144\x65\162"; } if (isset($data["\157\162\x64\x65\x72"]) && $data["\157\x72\x64\145\162"] == "\x44\105\x53\x43") { $sql .= "\40\x44\105\x53\103\x2c\x20\114\103\x41\x53\x45\50\x70\x64\x2e\156\141\x6d\x65\51\40\x44\x45\x53\103"; } else { $sql .= "\x20\x41\x53\x43\54\40\x4c\x43\x41\x53\x45\x28\x70\x64\x2e\x6e\141\155\145\51\x20\x41\123\x43"; } $product_data = array(); $query = $this->db->query($sql); foreach ($query->rows as $result) { $product_data[$result["\x70\162\157\x64\x75\x63\164\137\x69\144"]] = $this->getProduct($result["\160\162\157\x64\x75\143\164\x5f\x69\144"], $data["\x6c\x61\x6e\x67\x75\141\x67\145\x5f\151\144"], $data["\x73\164\x6f\162\x65\x5f\151\x64"]); } return $product_data; } public function getProductAttributes($product_id, $language_id) { $product_attribute_group_data = array(); $product_attribute_group_query = $this->db->query("\123\105\x4c\x45\103\x54\40\x61\147\56\141\x74\164\162\x69\x62\165\x74\x65\x5f\x67\x72\x6f\165\x70\137\151\144\54\40\141\x67\144\56\156\141\155\145\x20\106\x52\117\115\40" . DB_PREFIX . "\x70\x72\x6f\x64\165\x63\x74\x5f\141\x74\164\162\151\142\x75\x74\145\40\x70\x61\x20\x4c\105\x46\124\40\x4a\117\x49\116\40" . DB_PREFIX . "\x61\x74\164\162\151\x62\x75\x74\145\x20\141\40\x4f\116\x20\x28\160\x61\56\x61\x74\164\x72\x69\142\x75\164\145\137\x69\x64\x20\x3d\x20\141\x2e\x61\x74\x74\162\x69\142\x75\164\145\x5f\x69\144\51\40\x4c\x45\106\x54\x20\x4a\x4f\111\116\40" . DB_PREFIX . "\x61\x74\164\162\151\x62\165\x74\145\137\x67\x72\157\165\160\40\x61\x67\x20\117\116\x20\x28\141\x2e\141\x74\x74\162\x69\142\165\x74\x65\x5f\x67\162\157\165\160\137\x69\144\40\x3d\x20\141\147\56\x61\x74\164\x72\x69\x62\x75\164\x65\137\147\x72\157\165\x70\137\151\144\51\x20\x4c\x45\106\124\40\x4a\117\111\x4e\x20" . DB_PREFIX . "\141\164\164\x72\151\142\x75\x74\x65\137\x67\162\x6f\x75\x70\137\x64\x65\x73\143\x72\151\160\164\151\x6f\x6e\40\x61\147\144\x20\x4f\116\x20\x28\x61\147\56\x61\164\x74\162\151\142\165\x74\x65\x5f\x67\x72\x6f\x75\x70\x5f\x69\144\x20\75\40\141\147\144\x2e\141\164\164\162\151\x62\x75\x74\145\x5f\x67\162\x6f\165\160\137\151\144\x29\40\127\110\x45\x52\105\40\160\x61\x2e\160\x72\157\x64\165\143\x74\137\151\x64\x20\x3d\x20\47" . (int) $product_id . "\47\x20\101\116\104\40\141\147\x64\x2e\x6c\x61\156\147\x75\141\x67\145\137\151\x64\40\x3d\40\47" . (int) $language_id . "\x27\x20\x47\x52\x4f\125\x50\40\x42\x59\40\141\x67\x2e\141\164\x74\x72\x69\142\x75\164\145\137\x67\x72\157\165\160\x5f\x69\x64\40\117\x52\x44\105\122\x20\x42\131\x20\x61\x67\x2e\x73\x6f\x72\164\x5f\157\x72\144\x65\x72\x2c\x20\x61\x67\144\56\x6e\141\x6d\145"); foreach ($product_attribute_group_query->rows as $product_attribute_group) { $product_attribute_data = array(); $product_attribute_query = $this->db->query("\123\x45\114\x45\103\124\x20\141\56\141\164\x74\162\151\x62\165\164\x65\x5f\151\x64\54\x20\141\144\x2e\156\141\155\x65\54\x20\160\141\x2e\x74\145\170\164\x20\106\122\117\115\x20" . DB_PREFIX . "\160\162\x6f\x64\165\x63\x74\137\x61\164\x74\162\x69\142\165\x74\145\x20\x70\x61\40\x4c\105\106\124\x20\112\x4f\111\x4e\40" . DB_PREFIX . "\141\164\164\162\151\x62\x75\164\x65\x20\x61\40\117\116\x20\x28\160\141\x2e\x61\164\x74\x72\x69\x62\165\164\x65\x5f\151\144\x20\x3d\40\141\56\141\x74\164\162\151\142\165\x74\145\137\x69\x64\x29\x20\x4c\105\x46\124\40\112\117\111\x4e\x20" . DB_PREFIX . "\x61\164\164\162\x69\x62\x75\x74\145\x5f\x64\145\163\143\162\151\x70\x74\x69\x6f\156\x20\141\x64\x20\117\116\x20\50\141\56\x61\x74\x74\162\x69\x62\x75\164\x65\137\151\x64\40\75\x20\141\x64\x2e\141\x74\164\162\151\x62\x75\x74\145\x5f\151\x64\51\x20\x57\x48\x45\x52\x45\40\x70\x61\56\160\162\x6f\x64\165\x63\x74\x5f\151\144\x20\x3d\x20\47" . (int) $product_id . "\47\40\x41\116\104\x20\141\x2e\141\x74\164\162\x69\142\165\164\145\137\x67\x72\x6f\165\x70\137\x69\144\40\x3d\x20\47" . (int) $product_attribute_group["\141\x74\x74\x72\x69\142\x75\x74\145\x5f\x67\162\x6f\x75\160\137\151\x64"] . "\x27\40\x41\116\x44\40\141\x64\56\x6c\x61\x6e\147\x75\141\147\145\137\x69\x64\40\x3d\x20\47" . (int) $language_id . "\x27\x20\x41\116\x44\x20\160\141\56\154\x61\x6e\x67\x75\x61\147\145\137\x69\144\x20\x3d\40\47" . (int) $language_id . "\47\x20\x4f\122\x44\x45\x52\40\102\x59\40\x61\56\163\157\162\164\137\x6f\x72\x64\145\162\x2c\40\x61\x64\56\x6e\x61\155\145"); foreach ($product_attribute_query->rows as $product_attribute) { $product_attribute_data[] = array("\156\141\x6d\145" => $product_attribute["\156\141\155\145"], "\164\x65\x78\164" => $product_attribute["\164\x65\170\x74"]); } $product_attribute_group_data[] = array("\156\x61\x6d\145" => $product_attribute_group["\156\x61\x6d\145"], "\x61\164\x74\162\x69\x62\x75\x74\x65" => $product_attribute_data); } return $product_attribute_group_data; } public function getProductOptions($product_id) { $product_option_data = array(); $product_option_query = $this->db->query("\123\105\x4c\105\103\124\40\x2a\x20\106\122\x4f\x4d\x20" . DB_PREFIX . "\160\162\x6f\144\165\143\x74\137\157\160\164\151\x6f\156\x20\x70\x6f\x20\114\105\x46\x54\40\112\117\111\116\x20\140" . DB_PREFIX . "\x6f\x70\x74\x69\x6f\156\x60\40\157\x20\x4f\116\x20\x28\160\x6f\56\157\160\164\x69\157\x6e\x5f\151\x64\40\75\x20\x6f\x2e\x6f\160\x74\151\157\x6e\137\x69\x64\x29\x20\x4c\105\x46\124\40\x4a\x4f\x49\116\x20" . DB_PREFIX . "\157\x70\164\151\157\x6e\137\x64\x65\x73\143\162\151\160\164\x69\x6f\x6e\40\157\144\40\117\x4e\40\50\157\56\157\160\x74\151\157\156\x5f\x69\144\40\75\40\157\144\56\x6f\x70\x74\151\x6f\156\x5f\151\144\x29\40\x57\x48\105\122\x45\40\160\x6f\56\x70\x72\x6f\x64\x75\x63\x74\137\x69\x64\x20\x3d\40\47" . (int) $product_id . "\x27\40\x41\x4e\x44\40\157\144\x2e\154\141\x6e\x67\x75\141\x67\x65\137\x69\144\40\x3d\40\47" . (int) $this->config->get("\143\x6f\156\146\151\x67\137\154\x61\x6e\147\165\x61\x67\x65\137\x69\144") . "\47\x20\x4f\x52\x44\105\122\40\102\x59\40\157\x2e\163\x6f\x72\x74\x5f\157\x72\144\x65\x72"); foreach ($product_option_query->rows as $product_option) { $product_option_value_data = array(); $product_option_value_query = $this->db->query("\x53\x45\x4c\x45\x43\x54\x20\52\x20\106\x52\117\115\40" . DB_PREFIX . "\x70\162\157\144\165\143\164\x5f\x6f\160\164\x69\157\x6e\137\x76\x61\154\x75\145\40\x70\x6f\166\x20\114\105\x46\124\40\x4a\x4f\x49\x4e\x20" . DB_PREFIX . "\157\160\x74\151\x6f\x6e\x5f\x76\x61\x6c\165\x65\x20\157\x76\40\117\x4e\40\50\x70\157\x76\56\x6f\x70\164\x69\157\x6e\x5f\166\x61\154\165\x65\x5f\x69\144\40\75\x20\157\166\x2e\157\x70\x74\x69\157\156\137\x76\141\x6c\x75\145\x5f\x69\144\x29\x20\114\x45\106\124\40\x4a\x4f\x49\116\x20" . DB_PREFIX . "\157\x70\164\x69\x6f\x6e\x5f\x76\x61\x6c\x75\x65\137\x64\145\163\143\x72\151\160\x74\x69\x6f\x6e\x20\157\x76\144\40\117\116\x20\50\x6f\x76\56\x6f\x70\164\x69\x6f\156\137\x76\141\154\x75\145\x5f\151\144\40\75\x20\x6f\166\144\56\157\x70\x74\x69\157\156\x5f\x76\x61\154\165\145\x5f\151\x64\x29\x20\127\x48\x45\122\105\40\x70\x6f\166\x2e\160\162\157\144\x75\x63\x74\x5f\151\144\x20\x3d\x20\x27" . (int) $product_id . "\47\x20\x41\x4e\x44\40\160\x6f\166\x2e\160\162\157\x64\x75\143\164\x5f\157\160\x74\x69\157\x6e\137\x69\144\x20\x3d\x20\x27" . (int) $product_option["\x70\x72\x6f\x64\x75\143\164\137\x6f\160\x74\151\157\156\137\151\x64"] . "\47\40\x41\116\104\x20\157\166\144\x2e\154\x61\x6e\x67\165\x61\x67\x65\137\x69\x64\40\75\x20\47" . (int) $this->config->get("\x63\157\156\146\x69\147\x5f\154\x61\156\147\x75\x61\147\145\x5f\x69\x64") . "\x27\x20\117\122\104\x45\x52\40\x42\131\x20\x6f\x76\56\163\x6f\x72\x74\x5f\x6f\x72\144\145\x72"); foreach ($product_option_value_query->rows as $product_option_value) { $product_option_value_data[] = array("\x70\162\x6f\x64\x75\x63\164\137\x6f\x70\x74\x69\x6f\x6e\137\x76\x61\x6c\x75\145\x5f\151\144" => $product_option_value["\x70\x72\157\144\165\143\x74\137\x6f\x70\164\x69\x6f\156\137\166\x61\154\x75\145\137\x69\144"], "\157\x70\x74\x69\x6f\156\x5f\x76\x61\x6c\x75\x65\137\151\144" => $product_option_value["\x6f\x70\x74\x69\x6f\x6e\x5f\166\141\x6c\x75\145\137\x69\144"], "\x6e\141\x6d\x65" => $product_option_value["\156\x61\x6d\x65"], "\151\x6d\141\147\x65" => $product_option_value["\x69\x6d\141\x67\x65"], "\161\165\141\x6e\164\151\164\171" => $product_option_value["\161\165\x61\x6e\164\151\x74\x79"], "\x73\x75\x62\x74\x72\x61\x63\164" => $product_option_value["\163\x75\x62\164\162\x61\x63\164"], "\160\x72\x69\143\x65" => $product_option_value["\160\x72\x69\143\145"], "\x70\162\151\143\x65\137\160\162\x65\x66\151\170" => $product_option_value["\x70\x72\151\x63\145\137\160\162\x65\146\x69\x78"], "\x77\x65\151\x67\x68\164" => $product_option_value["\x77\145\x69\147\x68\x74"], "\x77\145\151\147\x68\164\x5f\160\x72\145\x66\151\170" => $product_option_value["\x77\x65\x69\x67\x68\164\x5f\x70\162\x65\146\x69\170"]); } $product_option_data[] = array("\160\x72\x6f\x64\x75\x63\x74\137\157\160\164\x69\157\156\x5f\x69\x64" => $product_option["\x70\x72\x6f\144\165\x63\164\x5f\157\x70\164\151\157\156\137\x69\x64"], "\160\x72\157\144\165\x63\x74\137\x6f\160\164\151\157\x6e\x5f\x76\x61\154\x75\x65" => $product_option_value_data, "\x6f\160\164\151\x6f\156\x5f\x69\x64" => $product_option["\x6f\x70\x74\151\157\156\x5f\151\x64"], "\x6e\141\x6d\145" => $product_option["\x6e\141\x6d\145"], "\164\x79\x70\145" => $product_option["\164\171\160\x65"], "\x76\141\154\165\x65" => $product_option["\x76\x61\x6c\165\x65"], "\162\x65\161\165\151\162\145\x64" => $product_option["\x72\145\x71\165\151\162\x65\144"]); } return $product_option_data; } public function getProductImages($product_id) { $query = $this->db->query("\123\105\x4c\x45\x43\124\40\x2a\x20\106\x52\117\115\40" . DB_PREFIX . "\x70\x72\157\144\165\143\x74\x5f\x69\155\x61\x67\145\x20\127\x48\x45\x52\x45\40\160\x72\157\144\165\x63\164\x5f\x69\x64\x20\75\x20\x27" . (int) $product_id . "\x27\x20\x4f\122\x44\105\122\x20\x42\x59\40\x73\157\x72\164\x5f\x6f\162\x64\x65\x72\40\x41\123\103"); return $query->rows; } }
Function Calls
None |
Stats
MD5 | c25f1148e42c326abfd19ad3d82cb0ec |
Eval Count | 0 |
Decode Time | 119 ms |