update('referralprogram', array('id_cart_rule' => 0)); $sql = "SELECT DISTINCT(id_cart_rule_sponsor) FROM "._DB_PREFIX_."referralprogram"; $results = Db::getInstance()->ExecuteS($sql); foreach($results as $row) { //PS_cart_rule Db::getInstance()->update('cart_rule', array('cart_rule_restriction' => 1),'id_cart_rule='.$row['id_cart_rule_sponsor']); //PS_cart_rule_combination Db::getInstance()->delete('cart_rule_combination','id_cart_rule_1='.$row['id_cart_rule_sponsor'].' OR id_cart_rule_2='.$row['id_cart_rule_sponsor']); } */