Post by JeffroDH » Thu Jul 21, 2016 10:47 pm

I'm attempting to modify the "New Releases" Module such that it actually shows new releases and doesn't duplicate the data from the "Latest" Module. To that end, I've added this function to the end of the catalog/model/catalog/product.php class:

Code: Select all

	public function getNewReleases() {
		$query = $this->db->query("SELECT product_id FROM " . DB_PREFIX . "product WHERE date_available < curdate() AND date_available >= subdate(curdate(), 30)");
		$product_data = array();
		foreach ($query->rows as $result) {
			$product_data[$result['product_id']] = $this->getProduct($result['product_id']);
		return $product_data;
And then changed this:

Code: Select all

$results = $this->model_catalog_product->getProducts($filter_data);
to this:

Code: Select all

$test = $this->model_catalog_product->getNewReleases();
in the 'catalog/controller/module/new_releases.php' file.

I've added functions to different areas of Opencart hundreds of times, and never had any issues. Now, however, I'm getting this error:
Notice: Undefined property: Proxy::getNewReleases in /home/ahcomics/public_html/catalog/controller/module/new_releases.php on line 34
It seems to be thrown from 'system/engine/proxy.php', but I can't figure out why this function is causing problems. My best guess is that I've made some sort of syntax error, but I'm just not seeing it and banging my head against the wall.

Thanks in advance.

Active Member


Thu Jul 11, 2013 8:29 am

Post by straightlight » Thu Jul 21, 2016 11:14 pm

Could you post your module controller codes as well in order to analyze the problem?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

Straightlight Administrator / Quality Assurance Analyst / Programmer

Legendary Member


Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 16 guests