I want to implement something that would delete the empty categories and sub categories if there are no products in them.
There may be 100s of categories.So I don't want to use backend for this.
I am in trouble please help me.
I am referring this link Hide Empty Categories but this is only hiding parent categories from navigation bar even if it's sub categories have products in them.