Why does this produce an object?
$sql = $this->db->query("
SELECT 'product_id'
FROM " . DB_PREFIX . "product_to_category
WHERE category_id = '" . $this->db->escape($category['category_id']) . "'
");
And how to I get a string/array instead?
From Opencart
Related: Object of class stdClass could not be converted to string
You have an error in your query syntax, you put SELECT ‘product_id’ and you should not have apostrophies there.
You need to make this change.