Post by hyrdel » Tue Feb 25, 2014 1:28 am

Hi
When I copy product on products page, getting following message:

Warning: Illegal string offset 'layout_id' in /home/xxxxx/public_html/store/admin/model/catalog/product.php on line 107Warning: Illegal string offset 'layout_id' in /home/xxxx/public_html/store/admin/model/catalog/product.php on line 108Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/store/admin/index.php:81) in /home/xxxx/public_html/store/system/engine/controller.php on line 28Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/store/admin/index.php:81) in /home/xxxx/public_html/store/system/engine/controller.php on line 29

although the product is copied perfectly. Any help?

Newbie

Posts

Joined
Tue Feb 25, 2014 1:20 am

Post by Masane » Tue Oct 28, 2014 2:48 am

Go to /admin/model/catalog/product.php and replace this:

foreach ($data['product_layout'] as $store_id => $layout) {
if ($layout['layout_id']) {
$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_layout SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "', layout_id = '" . (int)$layout['layout_id'] . "'");
}
}

for this:

foreach ($data['product_layout'] as $store_id => $layout_id) {
if ($layout_id) {
$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_layout SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "', layout_id = '" . (int)$layout_id . "'");
}
}

:D

Newbie

Posts

Joined
Fri Sep 19, 2014 3:50 am

Post by ncwsolution » Tue Nov 04, 2014 3:41 pm

reinstalling all the modules also worked for me on opencart 1.5.6.4, and I Thank Masane for sharing the code if someone don't want to reinstall all modules, I also tested that and it was working for me.

User avatar
Newbie

Posts

Joined
Sun Nov 02, 2014 2:04 pm
Location - Pakistan
Who is online

Users browsing this forum: No registered users and 21 guests