{% endif %}
]]>
]]>
]]>
]]>
load->controller('module/' . $code);]]>
load->controller('module/' . $code,$setting);
]]>
load->controller('module/' . $code);]]>
load->controller('module/' . $code,$setting);
]]>
load->controller('module/' . $code);]]>
load->controller('module/' . $code,$setting);
]]>
customer->isLogged()) {
$customer_group_id = $this->customer->getGroupId();
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
$product_data = array();
$sql = "SELECT op.product_id, COUNT(*) AS total FROM " . DB_PREFIX . "order_product op LEFT JOIN `" . DB_PREFIX . "order` o
ON (op.order_id = o.order_id) LEFT JOIN `" . DB_PREFIX . "product` p ON (op.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s
ON (p.product_id = p2s.product_id) WHERE o.order_status_id > '0' AND p.status = '1' AND p.date_available <= NOW()
AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND p.manufacturer_id = '".(int) $manufacturer_id."'
GROUP BY op.product_id ORDER BY total DESC LIMIT " . (int)$limit;
$query = $this->db->query($sql);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
return $product_data;
}
public function getBestSellerCategoryProducts($category_id,$limit)
{
$product_data = array();
$sql = "SELECT op.product_id, COUNT(*) AS total FROM " . DB_PREFIX . "order_product op LEFT JOIN `" . DB_PREFIX . "order` o
ON (op.order_id = o.order_id) LEFT JOIN `" . DB_PREFIX . "product` p ON (op.product_id = p.product_id)
JOIN " . DB_PREFIX . "product_to_category p2c ON (p.product_id = p2c.product_id)
LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE o.order_status_id > '0'
AND p.status = '1' AND p.date_available <= NOW() AND p2c.category_id = '".(int) $category_id."'
AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'
GROUP BY op.product_id ORDER BY total DESC LIMIT " . (int)$limit;
$query = $this->db->query($sql);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
return $product_data;
}
public function getBestSellerKeywordProducts($keyword,$limit)
{
$keywords = explode(',',$keyword);
$product_data = array();
$name = '( ';
foreach($keywords as $key => $value)
{
$name .= " pd.name like '%".trim($value)."%' OR ";
}
$name = rtrim($name,'OR ');
$name .= ')';
$sql = "SELECT op.product_id, COUNT(*) AS total FROM " . DB_PREFIX . "order_product op LEFT JOIN `" . DB_PREFIX . "order` o
ON (op.order_id = o.order_id) LEFT JOIN `" . DB_PREFIX . "product` p ON (op.product_id = p.product_id)
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 o.order_status_id > '0'
AND p.status = '1' AND p.date_available <= NOW() AND $name
AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'
GROUP BY op.product_id ORDER BY total DESC LIMIT " . (int)$limit;
$query = $this->db->query($sql);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
return $product_data;
}
public function getLatestManufacturerProducts($manufacturer_id,$limit)
{
$product_data = array();
$sql = "SELECT p.product_id FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_to_store p2s
ON (p.product_id = p2s.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p.manufacturer_id = '".$manufacturer_id."'
AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY p.date_added DESC
LIMIT " . (int)$limit;
$query = $this->db->query($sql);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
return $product_data;
}
public function getLatestCategoryProducts($category_id,$limit)
{
$product_data = array();
$sql = "SELECT p.product_id FROM " . DB_PREFIX . "product p
JOIN " . DB_PREFIX . "product_to_category p2c ON (p.product_id = p2c.product_id)
LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.status = '1'
AND p.date_available <= NOW() AND p2c.category_id = '".$category_id."'
AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY p.date_added DESC
LIMIT " . (int)$limit;
$query = $this->db->query($sql);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
return $product_data;
}
public function getLatestKeywordProducts($keyword, $limit)
{
$product_data = array();
$keywords = array();
$keywords = explode(',',$keyword);
$product_data = array();
$name = '( ';
foreach($keywords as $key => $value)
{
$name .= " pd.name like '%".trim($value)."%' OR ";
}
$name = rtrim($name,'OR ');
$name .= ')';
$sql = "SELECT p.product_id FROM " . DB_PREFIX . "product p
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 p.status = '1'
AND p.date_available <= NOW() AND $name
AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY p.date_added DESC
LIMIT " . (int)$limit;
$query = $this->db->query($sql);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
return $product_data;
}
public function getSpecialManufacturerProducts($data)
{
if ($this->customer->isLogged()) {
$customer_group_id = $this->customer->getGroupId();
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
$sql = "SELECT DISTINCT ps.product_id, (SELECT AVG(rating) FROM " . DB_PREFIX . "review r1
WHERE r1.product_id = ps.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating
FROM " . DB_PREFIX . "product_special ps
LEFT JOIN " . DB_PREFIX . "product p ON (ps.product_id = p.product_id)
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 p.status = '1' AND p.date_available <= NOW() AND p.manufacturer_id = '".$data['manufacturer_id']."'
AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'
AND ps.customer_group_id = '" . (int)$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())) GROUP BY ps.product_id";
$sort_data = array(
'pd.name',
'p.model',
'ps.price',
'rating',
'p.sort_order'
);
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'] . ")";
} 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";
}
if (isset($data['start']) || isset($data['limit'])) {
if ($data['start'] < 0) {
$data['start'] = 0;
}
if ($data['limit'] < 1) {
$data['limit'] = 20;
}
$sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
}
$product_data = array();
$query = $this->db->query($sql);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
return $product_data;
}
public function getSpecialCategoryProducts($data)
{
if ($this->customer->isLogged()) {
$customer_group_id = $this->customer->getGroupId();
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
$sql = "SELECT DISTINCT ps.product_id, (SELECT AVG(rating) FROM " . DB_PREFIX . "review r1
WHERE r1.product_id = ps.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating
FROM " . DB_PREFIX . "product_special ps
LEFT JOIN " . DB_PREFIX . "product p ON (ps.product_id = p.product_id)
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)
JOIN " . DB_PREFIX . "product_to_category p2c ON (p.product_id = p2c.product_id)
WHERE p.status = '1' AND p.date_available <= NOW() AND p2c.category_id = '".$data['category_id']."'
AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'
AND ps.customer_group_id = '" . (int)$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())) GROUP BY ps.product_id";
$sort_data = array(
'pd.name',
'p.model',
'ps.price',
'rating',
'p.sort_order'
);
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'] . ")";
} 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";
}
if (isset($data['start']) || isset($data['limit'])) {
if ($data['start'] < 0) {
$data['start'] = 0;
}
if ($data['limit'] < 1) {
$data['limit'] = 20;
}
$sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
}
$product_data = array();
$query = $this->db->query($sql);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
return $product_data;
}
public function getSpecialKeywordProducts($data)
{
if ($this->customer->isLogged()) {
$customer_group_id = $this->customer->getGroupId();
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
$keywords = array();
$keywords = explode(',',$data['keyword']);
$product_data = array();
$name = '( ';
foreach($keywords as $key => $value)
{
$name .= " pd.name like '%".trim($value)."%' OR ";
}
$name = rtrim($name,'OR ');
$name .= ')';
$sql = "SELECT DISTINCT ps.product_id, (SELECT AVG(rating) FROM " . DB_PREFIX . "review r1
WHERE r1.product_id = ps.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating
FROM " . DB_PREFIX . "product_special ps
LEFT JOIN " . DB_PREFIX . "product p ON (ps.product_id = p.product_id)
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 p.status = '1' AND $name
AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'
AND ps.customer_group_id = '" . (int)$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())) GROUP BY ps.product_id";
$sort_data = array(
'pd.name',
'p.model',
'ps.price',
'rating',
'p.sort_order'
);
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'] . ")";
} 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";
}
if (isset($data['start']) || isset($data['limit'])) {
if ($data['start'] < 0) {
$data['start'] = 0;
}
if ($data['limit'] < 1) {
$data['limit'] = 20;
}
$sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
}
$product_data = array();
$query = $this->db->query($sql);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
return $product_data;
}
]]>
document->getTitle();]]>
document->addStyle("catalog/view/theme/default/stylesheet/velsofbanner/velsofbanner.css");
]]>
db->query("DELETE FROM `" . DB_PREFIX . "setting` WHERE store_id = '" . (int)$store_id . "' AND `code` = '" . $this->db->escape($code) . "'");
foreach ($data as $key => $value) {
if (VERSION >= '2.0') {
if (!is_array($data)) {
$this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '" . (int) $store_id . "', `code` = '" . $this->db->escape($code) . "', `key` = '" . $this->db->escape($key) . "', `value` = '" . $this->db->escape($data) . "'");
} else {
$this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '" . (int) $store_id . "', `code` = '" . $this->db->escape($code) . "', `key` = '" . $this->db->escape($key) . "', `value` = '" . $this->db->escape(json_encode($data, true)) . "', serialized = '1'");
}
} else {
if (!is_array($data)) {
$this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '" . (int) $store_id . "', `group` = '" . $this->db->escape($code) . "', `key` = '" . $this->db->escape($key) . "', `value` = '" . $this->db->escape($data) . "'");
} else {
$this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '" . (int) $store_id . "', `group` = '" . $this->db->escape($code) . "', `key` = '" . $this->db->escape($key) . "', `value` = '" . $this->db->escape(serialize($data)) . "', serialized = '1'");
}
}
}
}
]]>
Notice: Undefined property: Proxy::getProduct in
/var/www/html/velsofstore/catalog/controller/extension/lightning/beta.php on line
266