Page 1 of 1

Getting Notice: Undefined index: enquire in /catalog/controller/extension/module/featured.php

Posted: Thu Aug 24, 2017 7:13 pm
by dev123
Hi all,

I am new in OpenCart community. First of all thanks to opencart for making this product.

I need help from you.

I want to show an extra value when user open store site. To do this I edit feature.tpl and php page. Add column in database. But I am getting Notice: Undefined index: enquire in /catalog/controller/extension/module/featured.php in line 71 error after adding a new column and restarting opencart home page.

Here is the step that I have done :

Step 1: Added one column "enquire"(type int) in PRODUCT table.

Step 2: Update INSERT and UPDATE query of admin\model\catalog/product.php page (in addProduct($data) and editProduct($product_id, $data) function.)

Step 3: Edit admin\view\template\catalog\product_form.tpl to edit "enquire" field by admin user.

Step 4: Edit \catalog\view\theme\default\template\extension\module\featured.tpl to dispaly "enquire" field value.
<span class="fa fa-stack"><?php echo $product['enquire']; ?></span>

Step 5: Edit catalog\controller\extension\module\featured.php file to add "enquire" clolumn value in products array.

$data['products'][] = array(
'product_id' => $product_info['product_id'],
'thumb' => $image,
'name' => $product_info['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'rating' => $rating,
'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']),
'enquire' => $product_info['enquire']

After that when I restart application it getting error in the top of the page.

Can anyone guide/help me how I get value in step 4 ($product['enquire']).

Please help.

System Information: OpenCart Linux 64 bit / XAMPP 5.6.20

Re: Getting Notice: Undefined index: enquire in /catalog/controller/extension/module/featured.php

Posted: Sat Aug 26, 2017 11:48 pm
by opencartboost
You need add code in file product.php at catalog/model/catalog/product.php
Find :

Code: Select all

'model'            => $query->row['model'],
Add after :

Code: Select all

'enquire'            => $query->row['enquire'],

Re: Getting Notice: Undefined index: enquire in /catalog/controller/extension/module/featured.php

Posted: Mon Aug 28, 2017 10:20 pm
by dev123
Thank You very much,

You save my days....

its working.....