<?php 

class ModelExtensionModuleOutofstock extends Model {

	function getProducts(){

		$product_data = [];

		$sql = "SELECT * FROM `" . DB_PREFIX . "product` p LEFT JOIN `" . DB_PREFIX . "product_description` pd ON (p.`product_id` = pd.`product_id`) WHERE pd.`language_id` = '" . (int)$this->config->get('config_language_id') . "' AND p.`quantity` <= '0'";
		//echo $sql;exit;
		$query = $this->db->query($sql);

		foreach ($query->rows as $result) {

			$product_data[] = [
				'name'             => $result['name'],
				'product_id'      => $result['product_id'],
			];
		} 

		return $product_data;
	}	

}

