Refraining from praying and fasting
Is fasting accepted from one who does not pray?
One should never leave the prayer as God and the Prophet have made this clear. The Prophet (peace and blessings be upon him) said, “The covenant that is between us and them is prayer. Whoever has left the prayer has left Islam.” Also one does not want to fall into the words of God, “Then is it only a part of the Book that you believe in, and do you reject the rest? But what is the reward for those among you who behave like this but disgrace in this life.”
As for the issue of fasting being accepted or not, the scholars do not talk about it as the issue is left to God. We hope that God accepts the fast of all those who fast, even if the one who prays has a better chance of their fast being accepted than the one who does not.
Prayer is not one of the conditions for the validity of fasting. However, leaving prayer is a major sin and it is not permissible for a Muslim to do this. Whoever amongst the Muslims has left their prayers must return to God with sincere repentance.
And God Almighty knows best.