SELECT COUNT(distinct m.id_module) FROM ps_hook h LEFT JOIN ps_hook_module hm ON h.id_hook = hm.id_hook LEFT JOIN ps_module m ON hm.id_module = m.id_module
WHERE (h.name = "displayPayment" OR h.name = "payment") AND m.name NOT IN ("bankwire", "cheque", "cashondelivery")