Question: I want to show products in same category withing single product page. 
see bellow diagram what i want to achieve
[![live site example](https://i.stack.imgur.com/EJCJ2.jpg)](https://i.stack.imgur.com/EJCJ2.jpg) 
please see this site [<https://www.jackthreads.com/goodale/shirts/rutledge-navywhite-plaid-shirt/products/170189][1]> for more idea. i want to know how it achieve?

Answer: 
Try this code in your view.phtml 

```
<?php
$productId = $_product->getId();
$productCollection = Mage::getModel('catalog/product')->load($productId);
$catIds = $productCollection->getCategoryIds();
 foreach ($catIds as $categoryId) {
    $_productCollection = Mage::getModel('catalog/category')->load($categoryId)
            ->getProductCollection()
            ->addAttributeToSelect('*')
            ->addAttributeToFilter('status', 1)
            ->addAttributeToFilter('visibility', 4);
            foreach($_productCollection as $catProducts){
                echo    $catProducts->getName();
                echo '<br>';
                    // get your product here 
            }

}

?>

```
you can achieve this with below code..

```
    <?php $cats = $_product->getCategoryIds(); 
foreach ($cats as $category_id) {
    $category_id; exit;
   $products = Mage::getModel('catalog/category')->load($category_id)
 ->getProductCollection()
; //sets the order by price
} 

var_dump($products);?>

```