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
try to render products with the .render() function
Expected behavior
It should render the template inside the _partials/product/{productType}.twig file
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
.render()
functionExpected behavior
It should render the template inside the
_partials/product/{productType}.twig
fileActual 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