Another free Opencart module for my visitors and subscribers, this extension will show “What People are buying right now?”. It lists out the recently ordered products.

To download the module click below:

Installation

Upload the folders ‘admin’ and ‘catalog’ and their files from the extracted directory to your server OpenCart main directory. Check this installation video if have any issues

OpenCart core files are not changed.

After installation:

You can edit the module and setup following:

Then setup in your preferred layout and you will see like below:

Query implemented is below:

public function getLatestOrderedProducts($limit)
{
	$product_data = "";
	$product_data = $this->cache->get('product.latestordered.' . (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) {
		$product_data = array();

		$query = $this->db->query("SELECT op.product_id 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') . "' ORDER BY o.order_id DESC LIMIT " . (int)$limit);
		foreach ($query->rows as $result) {
			$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
		}
		$this->cache->set('product.latestordered.' . (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;
}

Further help and customized versions:

This module has been successfully tested for a standard OpenCart 3.0.3.2.

If you need a customized version of this module and any other Opencart help and support then let me know and I can create one for a charge.

If you get any problem with the module then let me know by commenting.

4 COMMENTS

  1. Geeess… Rupak, I was getting quite impressed by you and as I use OC 1.5.6.1 I naturally got interested in this module. You state that this module is for free but then you require me to do something to download it thus it’s by no means free. Free means unconditional! You should of course:
    1. inform your readers that you want something in return for your “free” stuff BEFORE they click the “Read more…” link.
    2. let your readers DECIDE whether your module is worth a like or whatever.
    3. AVOID at all cost to WASTE your readers time and bandwidth to become a successful entrepreneur.
    Is this the way you conduct your business too? Don’t bother to reply, after all, it doesn’t matter coz I won’t stay here long enough to read your answer!
    BTW, feel free to contact me if and when you make the module true free or turn it commercial.

LEAVE A REPLY

Please enter your comment!
Please enter your name here