Ended up making a query:
$id_carro = intval($this->id_cart);
$codigo = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue("SELECT code FROM ps_cart_rule INNER JOIN ps_cart_cart_rule ON ps_cart_rule.id_cart_rule = ps_cart_cart_rule.id_cart_rule AND ps_cart_cart_rule.id_cart =".$id_carro.";");