Teaser 2960: Bags of sweets!

From The Sunday Times, 16th June 2019 [link]

I recently bought a number of equally priced bags of sweets for a bargain price, spending more than 50p in total. If they had been priced at 9p less per bag, I could have had 2 bags more for the same sum of money. In addition, if each had cost 12p less than I paid, then I could also have had an exact number of bags for the same sum of money.

How much did I spend in total on the sweets?

[teaser2960]