Question: I have a magento shop with over 3000 products and 1000 categories.

```
Category I
      Category 1
      Category 2
Category II
      Category 3
      Category 4

```

My problem is that all the products are only in the deepest categories. For example: A product in Category 3 also has to be in Category II, but it's not. Is there a way to do this via php script with all the products?

Thanks in advance!

Answer: 
```
android.support.v4.app.Fragment getCurrentFragment()
{
    Fragment currentFragment = getActivity().getSupportFragmentManager()
            .findFragmentById(R.id.frameLayout);
    return currentFragment;
}

```
```
public boolean checkFragmentAvailableOrNot1(String fragmentName) 
{
   Fragment fragment=getSupportFragmentManager().findFragmentByTag(fragmentName);
    if (fragment instanceof FragMercado && fragment.isVisible()) 
    {
        return true;
    }
    return false;
}

```