diff --git a/src/Controller/ProductController.php b/src/Controller/ProductController.php index de5812ec..9ac57f5b 100644 --- a/src/Controller/ProductController.php +++ b/src/Controller/ProductController.php @@ -216,9 +216,11 @@ public function listingAction(Request $request, HeadTitle $headTitleHelper, Brea public function productTeaserAction(Request $request, Factory $ecommerceFactory): Response { $paramsBag = []; - if ($request->attributes->get('type') === 'object') { + $type = $request->attributes->get('type')?:$request->query->get('type'); + if ($type === 'object') { AbstractObject::setGetInheritedValues(true); - $product = AbstractProduct::getById($request->attributes->getInt('id')); + $id = $request->attributes->getInt('id')?:$request->query->getInt('id'); + $product = AbstractProduct::getById($id); if ($product instanceof Car && $product->getObjectType() === Car::OBJECT_TYPE_VIRTUAL_CAR) { throw new \Exception('Virtual products are not allowed in product teasers.'); }