Post by mash0028 » Sat Aug 01, 2015 2:23 am

hello I hope I get answer to my simple question.

I duplicate the model (text) to add additional details about the products than having it written in description.
[img] Screen Shot 2015-08-01 at 2.18.27 AM.png
[/img]

File from: admin/controller/catalog/product.php

if (isset($this->request->get['product_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
$product_info = $this->model_catalog_product->getProduct($this->request->get['product_id']);




if (isset($this->request->post['model'])) {
$data['model'] = $this->request->post['model'];
} elseif (!empty($product_info)) {
$data['model'] = $product_info['model'];
} else {
$data['model'] = '';


everything is okay except this error:

Notice: Undefined index: usage in /home2/berrylen/public_html/admin/controller/catalog/product.php on line 802Notice: Undefined index: bc in /home2/berrylen/public_html/admin/controller/catalog/product.php on line 810Notice: Undefined index: madein in /home2/berrylen/public_html/admin/controller/catalog/product.php on line 818

ERROR LINE IS:

if (isset($this->request->post['usage'])) {
$data['usage'] = $this->request->post['usage'];
} elseif (!empty($product_info)) {
$data['usage'] = $product_info['usage'];
} else {
$data['usage'] = '';
}

if (isset($this->request->post['bc'])) {
$data['bc'] = $this->request->post['bc'];
} elseif (!empty($product_info)) {
$data['bc'] = $product_info['bc'];
} else {
$data['bc'] = '';
}

if (isset($this->request->post['madein'])) {
$data['madein'] = $this->request->post['madein'];
} elseif (!empty($product_info)) {
$data['madein'] = $product_info['madein'];
} else {
$data['madein'] = '';
}



as written above code:

if (isset($this->request->get['product_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
$product_info = $this->model_catalog_product->getProduct($this->request->get['product_id']);


product_info is in model/catalog/product and get product_id, if I am correct. where should I put additional code in product.tpl

Hoping for your kind response about product_info or product_id. :) ;) :D ;D


I already made in it, but I got an error with product_info. :)

Attachments

Screen Shot 2015-08-01 at 2.18.27 AM.png

admin view: - Screen Shot 2015-08-01 at 2.18.27 AM.png (54.82 KiB) Viewed 844 times

Last edited by mash0028 on Wed Nov 04, 2015 4:37 pm, edited 1 time in total.

New member

Posts

Joined
Fri Jul 24, 2015 3:36 pm

Post by artcore » Sat Aug 01, 2015 4:43 am

Did you add the columns 'usage' and 'bc' to the product table? product_info returns all the db columns for that id. If they don't exist it'll give the error.
You could use existing unused fields for this, like 'location' and perhaps 'ean' as an easier solution

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by mash0028 » Mon Oct 12, 2015 5:32 pm

thank you for reply, Yes I already use those extra field for my product details

Thank you

New member

Posts

Joined
Fri Jul 24, 2015 3:36 pm

Post by straightlight » Tue Oct 13, 2015 7:32 am

Can you demonstrate a screenshot of your product table fields from PHPMyAdmin? For now, it looks like you created those fields only from the form but not from PHPMyAdmin. The Opencart Admin Product Model loads all the fields from the product table of the database; no exceptions.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Users browsing this forum: No registered users and 7 guests