Skip to content

Commit

Permalink
Merge remote-tracking branch 'normal/10.3' into 11.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	dump/data-1-settings_store.sql
#	src/Controller/ProductController.php
  • Loading branch information
kingjia90 committed Jan 18, 2023
2 parents f922638 + ce3356e commit 8122f11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Controller/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ public function productTeaserAction(Request $request, Factory $ecommerceFactory)
if ($request->attributes->get('type') === 'object') {
AbstractObject::setGetInheritedValues(true);
$product = AbstractProduct::getById($request->attributes->getInt('id'));

if ($product instanceof Car && $product->getObjectType() === Car::OBJECT_TYPE_VIRTUAL_CAR) {
throw new \Exception('Virtual products are not allowed in product teasers.');
}
$paramsBag['product'] = $product;

//track product impression
Expand Down
1 change: 1 addition & 0 deletions templates/areas/product-teaser/view.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
editmode: editmode,
controller: 'App\\Controller\\ProductController::productTeaserAction',
title: 'Drag a product here',
className: 'Car',
height : 'auto',
width: '100%'
})
Expand Down

1 comment on commit 8122f11

@kingjia90
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops, it appears as normal/10.3 but i have a separate phpstorm project to manage both demos and was like that 馃檲
image

Please sign in to comment.