# How can we display products from a specific category on the "/checkout/cart" page?

**URL:** <https://forum.shopware.com/t/how-can-we-display-products-from-a-specific-category-on-the-checkout-cart-page/68649>\
**Category:** Programming (EN)\
**Tags:** customelements\
**Created:** [28. Juli 2020 um 15:11 UTC](https://forum.shopware.com/t/how-can-we-display-products-from-a-specific-category-on-the-checkout-cart-page/68649 "2020-07-28T15:11:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spankracht](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@spankracht](https://forum.shopware.com/u/spankracht)\
**Post date:** [28. Juli 2020 um 15:11 UTC](https://forum.shopware.com/t/how-can-we-display-products-from-a-specific-category-on-the-checkout-cart-page/68649/1 "2020-07-28T15:11:19Z")

</div>

Hello!

Hopefully someone here can help us out with the following.

**What we want to achieve:**  
Display some products from a specific productcategory below the shopping cart ({url}/checkout/cart).

**Our idea:**  
Fetch the products via an Event Subscriber that add the data to the pagelet for use in the template; as explained here:  
[https://docs.shopware.com/en/shopware-platform-dev-en/how-to/add-data-to-a-storefront-page](https://docs.shopware.com/en/shopware-platform-dev-en/how-to/add-data-to-a-storefront-page)

**The problem:**  
While trying to fetch a category (by ‚name‘ / or ‚active == 1‘ for example)&nbsp;and it’s assosiated products, we get the following 500 error:

_MappingEntityClassesException - ‚Mapping definition neither have entities nor collection.‘_

Somehow the same code (follows below) works fine when we try to access the **productRepository** instead of the **productCategoryRespository**.

Can someone please help us out?

Thank&nbsp;you in advance!

_Code snippets follow below._

**UpsellSubscriber.php**

```
productRepository = $productRepository;
        $this->productCategoryRepository = $productCategoryRepository;
    }

    public static function getSubscribedEvents(): array
    {
        return [
			FooterPageletLoadedEvent::class => 'getProductsFromCategory'  
        ];
    }

    public function getProductsFromCategory(FooterPageletLoadedEvent $event): void
    {
		$criteria = new Criteria();
		//$criteria->addFilter(new EqualsFilter('name', 'Minicontainer'));
		$criteria->addFilter(new EqualsFilter('active', '1'));

		$entities = $this->productCategoryRepository->search(
			$criteria,
			$event->getContext()
		);

		var_dump($entities);
		die();

		//$event->getPagelet()->addExtension('custom_upsell', $category);
    }
}

```

**Services.xml**

&nbsp;

---

<div class="post-metadata">

**Author:** ![akuehnis](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@akuehnis](https://forum.shopware.com/u/akuehnis)\
**Post date:** [30. September 2020 um 15:07 UTC](https://forum.shopware.com/t/how-can-we-display-products-from-a-specific-category-on-the-checkout-cart-page/68649/2 "2020-09-30T15:07:35Z")

</div>

I am running in exactely the same problem. Have you found a solution for this problem?

---

<div class="post-metadata">

**Author:** ![el\_afilador](https://avatars.discourse-cdn.com/v4/letter/e/ebca7d/32.png) [@el\_afilador](https://forum.shopware.com/u/el_afilador)\
**Post date:** [24. November 2020 um 22:57 UTC](https://forum.shopware.com/t/how-can-we-display-products-from-a-specific-category-on-the-checkout-cart-page/68649/3 "2020-11-24T22:57:52Z")

</div>

Hi!

Try to revert the code to&nbsp; **productRepository&nbsp;** and filter on a specific category id.

---

<div class="post-metadata">

**Author:** ![Gunnarius](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@Gunnarius](https://forum.shopware.com/u/Gunnarius)\
**Post date:** [15. Juni 2021 um 09:23 UTC](https://forum.shopware.com/t/how-can-we-display-products-from-a-specific-category-on-the-checkout-cart-page/68649/4 "2021-06-15T09:23:54Z")

</div>

Have you found a solution?  
I am having a similiar problem. I am trying to get the name(s) of a dynamic product group of a product.
