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: 
```
Fragment getCurrentFragment()
{
    Fragment currentFragment = getSupportFragmentManager()
            .findFragmentById(R.id.content_frame);
    return currentFragment;
}

```

calling function like this

```
Fragment visibleFragment=getCurrentFragment();

```

calling this function you can get current visible fragment.if Any confusion then feel for free to ask thankx :)
```
android.support.v4.app.Fragment getCurrentFragment()
{
    Fragment currentFragment = getActivity().getSupportFragmentManager()
            .findFragmentById(R.id.frameLayout);
    return currentFragment;
}

```