Los Angeles (CNN) -- The former host of the Food Network's "Calorie Commando" was sentenced Monday to nine years in a California prison after pleading no contest to soliciting two homeless men to kill his wife, Los Angeles Superior Court spokeswoman Elizabeth Martinez said.

Juan-Carlos Cruz's wife was also in court during the sentencing, Martinez said.

Fertility issues were at the center of the murder-for-hire plot, according to sources close to the couple.

Authorities alleged that Cruz offered the two homeless men $500 to kill his wife, Shiara Davila-Morales of the Los Angeles County District Attorney's Office said.

Police in Santa Monica, California, set up a sting and videotaped Cruz arranging the murder with the two men, Davila-Morales said. Cruz even drove one of them to his apartment and showed him how to get into the secure building, she said.

Cruz was also ordered to serve half of the nine years before he is eligible to be paroled, Martinez said.

No victim impact statement was ordered, the spokeswoman said.

Cruz's plea agreement called for the nine-year sentence, the Los Angeles County District Attorney's Office said in late October after the plea was announced.

One count of attempted murder was dropped as part of the plea settlement, the prosecutor said at the time.

Two sources close to the couple, who asked not to be identified because of the sensitivity of the matter, said their 20-year struggle to have a child overwhelmed them.

After spending a lot of money on unsuccessful fertility treatments, Cruz's wife, Jennifer Campbell, was "very depressed and talked about suicide," one source said.

The sources suggested that she may have wanted to end her life but that as a devout Roman Catholic, she believed suicide was a sin.

The failure to have a successful pregnancy was a "pretty overwhelming thing in their lives," the second source said.

The source closest to Campbell said she still loves her husband despite his arrest. The source would not comment on whether she was aware of the alleged planning before his arrest.

The source closest to Cruz, 48, said he was "nothing but a loving and devoted husband."

CNN was unable to talk Cruz or Campbell directly.

The criminal complaint accused Cruz of trying to hire David Carrington and David Walters -- homeless men who go by the street names Little Dave and Big Dave -- to murder Campbell. It was not immediately clear who was Little Dave and who was Big Dave.

The plan fell apart when one of the men informed Santa Monica police, Sgt. Jay Trisler said.

Little Dave told the celebrity news and gossip website TMZ that he was approached first by Cruz, who asked him to kill his wife for cash, and he told his friend Big Dave.

Big Dave said he told a Santa Monica police officer about the plot after he was arrested for loitering.

"We're very fortunate that we have a relationship and rapport with some of the homeless and that they were able to give us information," Trisler said.

Santa Monica police began their undercover investigation of Cruz on May 7, Trisler said. Cruz was arrested later that month at a dog park in the Cheviot Hills neighborhood of Los Angeles, he said.

Big Dave and Little Dave got a place to stay while the investigation was under way. Santa Monica police put them in a hotel room to keep them out of sight, Big Dave said.

"They gave us two pizzas, a 12-pack of beer and a bottle of San Jose (tequila)," he said. "I love them."

Cruz, a Los Angeles resident, was an overweight pastry chef at the Hotel Bel Air until he changed his focus to promote low-calorie recipes.

He wrote "The Juan-Carlos Cruz Calorie Countdown Cookbook: A 5-Week Eating Strategy for Sustainable Weight Loss," published in 2007.

The Food Network issued a short statement in October saying Cruz "has not been under contract or associated with Food Network for a number of years."