A Birkby man stole from a Huddersfield shop to fund his drug habit.
Richard Hall, of Poplar Street, appeared at Kirklees Magistrates’ Court.
He pleaded guilty to stealing T-shirts worth £34 from TK Maxx.
The theft happened at the Kingsgate Shopping Centre branch on March 23.
Hall, 37, was stopped by staff and the goods were recovered.
He tested positive for the use of cocaine and opiates following his arrest.
Hall also admitted to a charge of failing to attend a follow-up assessment with the Lifeline drugs service.
Marnat Ali, mitigating, explained that his client had experienced difficulties with alcohol and drugs from an early age and this had led to his offending.
Mr Ali added: “These difficulties have plagued his life and all his offending is related to this.
“He knows he now has to start from scratch and overcome his addiction.”
Magistrates sentenced Hall to six months of drug treatment.
He also has to pay £60 fine and £60 victim surcharge.