Praise be to Allah.
The scholars differed concerning this matter, and there are two views, which have been explained in the answer to question no. 22862.
We have mentioned that the most correct view is that it is permissible, subject to two conditions:
1 – That the product is sold for its usual price, and that the price is not increased because of the prize. If the price is raised because of the prize then this is gambling and it is not permissible.
2 – That the person buys the product because he needs it. If he buys it only because of the prize, and he has no need of the product, this is a kind of gambling and wasting money.
And Allaah knows best.