Landing Page Creator v0.1 by Velocity landingpagecreator 0.1 2.2.1 Ayush Giri load->model('catalog/product');]]> load->model('setting/setting'); $this->load->model('landingpagecreator/landingpagecreator'); $landingpageupdates = $this->model_landingpagecreator_landingpagecreator->LandingPages(0); if(count($landingpageupdates) > 0){ foreach($landingpageupdates as $landingpageupdate){ $settings = $this->model_setting_setting->getSetting($landingpageupdate, 0); if(count($settings) > 0){ foreach ($settings['landingpageupdate']as $landingpagekey => $landingpage) { if($landingpage['page']['enable']==1) { if($landingpage['page']['seo']!=''){ $output .= ''; $final_link=str_replace('/index.php?route=','/',$this->url->link($landingpage['page']['seo'])); $output .= '' . $final_link . ''; $output .= 'weekly'; $output .= '1.0'; $output .= ''; } else { $output .= ''; $output .= '' . $this->url->link('landingpage/landingpage', 'page_id=' . $landingpagekey) . ''; $output .= 'weekly'; $output .= '1.0'; $output .= ''; } } } } } } ]]> row['query']);]]> request->get['page_id'] = $url[1]; } ]]> row['query'] && $url[0] != 'information_id' && $url[0] != 'manufacturer_id' && $url[0] != 'category_id' && $url[0] != 'product_id') {]]> row['query'] && $url[0] != 'information_id' && $url[0] != 'manufacturer_id' && $url[0] != 'category_id' && $url[0] != 'product_id' && $url[0] != 'page_id') { ]]> request->get['route'] = 'product/manufacturer/info';]]> request->get['route'] = 'product/manufacturer/info'; } elseif (isset($this->request->get['page_id'])) { $this->request->get['route'] = 'landingpage/landingpage'; ]]> model_catalog_product->getBestSellerProducts($setting['limit']);]]> model_catalog_product->getBestSellerManufacturerProducts($setting['manufacturer_id'],$setting['limit']); } else if((isset($setting['criteria']))&&($setting['criteria'] == 'Category')) { $results = $this->model_catalog_product->getBestSellerCategoryProducts($setting['category_id'],$setting['limit']); } else if((isset($setting['criteria']))&&($setting['criteria'] == 'Keyword')) { $results = $this->model_catalog_product->getBestSellerKeywordProducts($setting['keyword'],$setting['limit']); } else { $results = $this->model_catalog_product->getBestSellerProducts($setting['limit']); } ]]> $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']), 'position' => $setting['position'] ); } else{ $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']), ); } ]]> ]]> {% else %}
{% endif %} ]]> model_catalog_product->getProducts($filter_data);]]> model_catalog_product->getLatestManufacturerProducts($setting['manufacturer_id'],$setting['limit']); } else if((isset($setting['criteria']))&&($setting['criteria'] == 'Category')) { $results = $this->model_catalog_product->getLatestCategoryProducts($setting['category_id'],$setting['limit']); } else if((isset($setting['criteria']))&&($setting['criteria'] == 'Keyword')) { if(trim($setting['keyword']) == '') { $results = $this->model_catalog_product->getProducts($filter_data); } else { $results = $this->model_catalog_product->getLatestKeywordProducts($setting['keyword'],$setting['limit']); } } else { $results = $this->model_catalog_product->getProducts($filter_data); } ]]> $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']), 'position' => $setting['position'] ); } else{ $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']), ); } ]]> ]]> {% else %}
{% endif %} ]]> model_catalog_product->getProductSpecials($filter_data);]]> model_catalog_product->getSpecialManufacturerProducts($filter_data); } else if((isset($setting['criteria']))&&($setting['criteria'] == 'Category')) { $filter_data['category_id'] = $setting['category_id']; $results = $this->model_catalog_product->getSpecialCategoryProducts($filter_data); } else if((isset($setting['criteria']))&&($setting['criteria'] == 'Keyword')) { $filter_data['keyword'] = $setting['keyword']; $results = $this->model_catalog_product->getSpecialKeywordProducts($filter_data); } else { $results = $this->model_catalog_product->getProductSpecials($filter_data); } ]]> ]]> {% else %}
{% endif %} ]]> config->get('featured_product'));]]> load->model('landingpagecreator/landingpagecreator'); if((isset($setting['criteria']))&&($setting['criteria'] == 'Manufacturer')) { $products = $this->model_landingpagecreator_landingpagecreator->getFeaturedManufacturerProducts($setting['manufacturer_id'],$products); } else if((isset($setting['criteria']))&&($setting['criteria'] == 'Category')) { $products = $this->model_landingpagecreator_landingpagecreator->getFeaturedCategoryProducts($setting['category_id'],$products); } else if((isset($setting['criteria']))&&($setting['criteria'] == 'Keyword')) { if(trim($setting['keyword']) != '') { $products = $this->model_landingpagecreator_landingpagecreator->getFeaturedKeywordProducts($setting['keyword'],$products); } } ]]> config->get('featured_product'));]]> load->model('landingpagecreator/landingpagecreator'); if((isset($setting['criteria']))&&($setting['criteria'] == 'Manufacturer')) { $products = $this->model_landingpagecreator_landingpagecreator->getFeaturedManufacturerProducts($setting['manufacturer_id'],$products); } else if((isset($setting['criteria']))&&($setting['criteria'] == 'Category')) { $products = $this->model_landingpagecreator_landingpagecreator->getFeaturedCategoryProducts($setting['category_id'],$products); } else if((isset($setting['criteria']))&&($setting['criteria'] == 'Keyword')) { if(trim($setting['keyword']) != '') { $products = $this->model_landingpagecreator_landingpagecreator->getFeaturedKeywordProducts($setting['keyword'],$products); } } ]]> $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), 'quick' => $this->url->link('product/quick_view','&product_id=' . $product_info['product_id']), 'position' => $setting['position'] ); } else{ $data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), 'quick' => $this->url->link('product/quick_view','&product_id=' . $product_info['product_id']) ); } ]]> ]]> ]]> {% else %}
{% 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