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?
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 . "'");
}
}

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 . "'");
}
}

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.
Who is online
Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot] and 11 guests