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 2.3.0.2/ Linux 64 bit / XAMPP 5.6.20
You need add code in file product.php at catalog/model/catalog/product.php
Find :
Add after :
Find :
Code: Select all
'model' => $query->row['model'],
Code: Select all
'enquire' => $query->row['enquire'],
Who is online
Users browsing this forum: 7cswinery, Bing [Bot] and 36 guests