Skip to content

Commit 8122f11

Browse files
committed
Merge remote-tracking branch 'normal/10.3' into 11.x
# Conflicts: # dump/data-1-settings_store.sql # src/Controller/ProductController.php
2 parents f922638 + ce3356e commit 8122f11

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Controller/ProductController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ public function productTeaserAction(Request $request, Factory $ecommerceFactory)
220220
if ($request->attributes->get('type') === 'object') {
221221
AbstractObject::setGetInheritedValues(true);
222222
$product = AbstractProduct::getById($request->attributes->getInt('id'));
223-
223+
if ($product instanceof Car && $product->getObjectType() === Car::OBJECT_TYPE_VIRTUAL_CAR) {
224+
throw new \Exception('Virtual products are not allowed in product teasers.');
225+
}
224226
$paramsBag['product'] = $product;
225227

226228
//track product impression

templates/areas/product-teaser/view.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
editmode: editmode,
1111
controller: 'App\\Controller\\ProductController::productTeaserAction',
1212
title: 'Drag a product here',
13+
className: 'Car',
1314
height : 'auto',
1415
width: '100%'
1516
})

0 commit comments

Comments
 (0)