craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
226 stars 170 forks source link

[5.x]: Commerce products do not support the `render` function #3742

Open white-lukas opened 2 hours ago

white-lukas commented 2 hours ago

What happened?

Description

When trying to render a commerce product with the render() function, the following exception is thrown. Element doesn’t have a field layout provider that defines a handle, so it can’t be rendered with a partial template.

Steps to reproduce

  1. try to render products with the .render() function

Expected behavior

It should render the template inside the _partials/product/{productType}.twig file

Actual behavior

exception thrown

Craft CMS version

5.4.9

Craft Commerce version

5.2.1

PHP version

8.3.12

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

linear[bot] commented 2 hours ago

PT-2285 [5.x]: Commerce products do not support the `render` function