Дата публикации : 2019.11.30
Автор:Виноградов Александр
Рейтинг статьи:
Импорт описаний к товару из таблицы сторонней cms в Opencart OcStore
<?php
$items = $this->db->query("SELECT * FROM tovar ")->rows;
foreach ($items as $item):
echo $item['item'] . "<br>";
$tovar = $this->db->query("SELECT * FROM " . DB_PREFIX . "product where sku=" . $item['id'])->row;
if (isset($tovar))
{
$desk = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_description where product_id=" . $tovar['product_id'])->row;
$item['desk'] = str_replace("'", "", $item['desk']);
$this->db->query("UPDATE " . DB_PREFIX . "product_description set description='" . $item['desk'] . "' where product_id=" . $tovar['product_id']);
}
endforeach;
?>