Preheat the slow cooker if necessary; see the manufacturer's instructions. Drain the gammon joint and put it into the slow cooker pot. Press the cloves into 5 of the onion wedges and add with the remaining onion wedges and carrot slices to the gammon. Tip in the drained beans and add the bay leaves.
Pour the cola into a saucepan, add the sugar, tomato purée and mustard and bring to the boil, stirring. Pour over the gammon, cover with the lid and cook on high for 6–7 hours or until the gammon is tender.
Strain the cooking liquid into a saucepan and boil rapidly for 10 minutes to reduce by half. Keep the gammon and vegetables hot in the turned-off slow cooker with the lid on.
Slice the gammon thinly and arrange on plates with the vegetables, beans and a drizzle of sauce. Serve with baked potatoes and broccoli, if liked.