public static function correctProductId($productIdChange)
{
$db = Factory::getDBO();
if (!empty($productIdChange)) {
foreach ($productIdChange as $new => $old) {
if ($new == $old) {
continue;
}
$q = 'UPDATE #__phocacart_product_related SET product_b = ' . (int) $new . ' WHERE product_b = ' . (int) $old;
$db->setQuery($q);
$db->execute();
}
}
return true;
}