Post by Renecek » Sat Oct 08, 2016 11:20 pm

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 :)

New member

Posts

Joined
Thu Dec 10, 2015 7:12 pm

Post by EvolveWebHosting » Sat Oct 08, 2016 11:55 pm

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 :)
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.

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.evolvewebhost.com


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA

Post by Renecek » Sun Oct 09, 2016 1:45 am

Sorry, I need it on external page. For example www.mysite.com/index.php?route=product/latest

New member

Posts

Joined
Thu Dec 10, 2015 7:12 pm

Post by Johnathan » Sun Oct 09, 2016 10:49 pm

My Extra Product Pages extension can do this, but if you're looking for a free one, the only ones I see are these:

http://www.opencart.com/index.php?route ... n_id=17498
http://www.opencart.com/index.php?route ... n_id=15374

Those are both only for OpenCart 1.5, but if you contact the developers they may be willing to update them for OpenCart 2.2. If not, you might have to purchase a commercial extension, or find someone who can update one of those old extensions for you.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Renecek » Sun Oct 09, 2016 11:02 pm

Just thinking, is possible to duplicate for example special module? Special module has external page with special products so maybe if I change "special" for "latest" etc.. or not?

New member

Posts

Joined
Thu Dec 10, 2015 7:12 pm

Post by Johnathan » Tue Oct 11, 2016 12:00 am

Yeah, you could try doing that, if you're handy with code. You'd need to duplicate all the files associated with the product/special route, and rename all instances of "special" in the code to "latest":

/catalog/controller/product/special.php
/catalog/language/YOURLANGUAGE/product/special.php
/catalog/view/theme/YOURTHEME/template/product/special.tpl

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Renecek » Tue Oct 11, 2016 1:13 am

Thank you, tried but get errors..

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

hosting/catalog/model/catalog/product.php

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;
	}

New member

Posts

Joined
Thu Dec 10, 2015 7:12 pm
Who is online

Users browsing this forum: No registered users and 72 guests