Cheats

The only way to cheat in Candy Box 2 is by save editing. To do that, you must have unlocked the saving tab.

Cheating more candies
Go there, then click "Get the current game as text" button. A very long text should appear in the box below. Scroll down until you see "number gameCandiesCurrent= ", where is the amount of candies you have. Replace the number of candies you have with the number of candies you want. Then copy the whole thing (Tip: triple-click in the box and it should select it all) and paste it into the box at the very bottom, then click "Load".

Cheating more lollipops
Do the same as with the candies, but instead, search for "number gameLollipopsCurrent= ", where is the number of lollipops you have.

The same applies for Chocolate bars and Pains au chocolat.

Cheating more health
To get more health, you must go to the saving tab, click "Get the current game as text" and search for "number playerHp=" and you know what to do.