OC 2.2.0.
Thank you

Yes it can be created but it depends how you want to go about it. If you want it on the home page, just add the 'latest' module and that's it for the home page. If it's on another page, it's a different story. We'd need more specifics on where you want it.Renecek wrote:Hello, is there any way to create page with latest products? I know, there are a lot of modules but every module is paid..
OC 2.2.0.
Thank you
Opencart Hosting Plans, Domain Registration, Microsoft and Google Email and More
Visit our website for great deals and most importantly, fast and friendly support - www.evolvewebhosting.com
Code: Select all
Warning: Missing argument 1 for ModelCatalogProduct::getLatestProducts() in hosting/catalog/model/catalog/product.php on line 249Notice: Undefined variable: limit in hosting/catalog/model/catalog/product.php on line 250Notice: Undefined variable: limit in hosting/catalog/model/catalog/product.php on line 253Notice: Undefined variable: limit in hosting/catalog/model/catalog/product.php on line 259Notice: Undefined index: latest in hosting/catalog/controller/product/latest.php on line 125Notice: Undefined index: latest in hosting/catalog/controller/product/latest.php on line 132
Code: Select all
public function getLatestProducts($limit) {
$product_data = $this->cache->get('product.latest.' . (int)$this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $this->config->get('config_customer_group_id') . '.' . (int)$limit);
if (!$product_data) {
$query = $this->db->query("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 p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY p.date_added DESC LIMIT " . (int)$limit);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
}
$this->cache->set('product.latest.' . (int)$this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $this->config->get('config_customer_group_id') . '.' . (int)$limit, $product_data);
}
return $product_data;
}
Users browsing this forum: No registered users and 50 guests