Ayres, who has previous convictions, pleaded guilty to the two thefts involving razor blades valued at £130 and £138.49.

Chesterfield magistrates' court.

The court heard Ayres was released from custody earlier in October before he began re-offending within days by committing the two thefts.

Defence solicitor Kevin Tomlinson said: “Mr Ayres would probably be categorised as a prolific offender in terms of shoplifting, sadly.”

Mr Tomlinson explained Ayres was released from custody on October 22 but because of the short sentence he did not receive discharge grant money and he has also been struggling for cash due to delays with universal credit.

Ayres also had no lighting or heating at his address, according to Mr Tomlinson, and he was driven to stealing items to sell and on the first occasion he was successful and made a small amount of money.

However, Mr Tomlinson said Ayres was detained during the second theft because he is known in the town centre stores.

District Judge Andrew Davison described Ayres’s criminal record as very long and sad and he recognised that drugs was the problem underpinning his offending.

He said: “It is a very long and sad record and the problem underpinning this is drugs.