getting null value while passing a variable from model to controller in PHP with the following code. Actually I am not able to pass the quantity from model to controller.
model ->
public function getcomboProduct ($product_id) {
$combo_product_data = array();
$query = $this->db->query("Select bundled_id,qty FROM " . DB_PREFIX . "product_bundle where
product_id=" . $product_id . "");
foreach ($query->rows as $result) {
$combo_product_data[$result['bundled_id']] = $this->getProduct($result['bundled_id']);
$combo_product_data[$result['quantity']] = $result['qty'];
}
return $combo_product_data;
}
controller ->
$results = $this->model_catalog_product->getcomboProduct($product_id);
foreach ($results as $result) {
$data['comboproducts'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'quantity' => $result['quantity'],
'name' => $result['name'],
'price' => $price,
'href' => $this->url->link('product/product', 'product_id=' . $result['product_id'])
);
}