You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a field named 'price' that uses the new 'money' field type. When attempting to display the value of the field in a template I get an error "Object of class Money\Money could not be converted to string"
richhayler
changed the title
[4.x]: Error outputting value of money field in templates
[4.0.2]: Error outputting value of money field in templates
May 18, 2022
What happened?
Description
I have a field named 'price' that uses the new 'money' field type. When attempting to display the value of the field in a template I get an error "Object of class Money\Money could not be converted to string"
According to the documentation I should be able to output the value of the field price as
{{ entry.price }}
https://craftcms.com/docs/4.x/money-fields.html
Steps to reproduce
In my case I have a channel section with the handle "artworks" and an entry type that has a money field with the handle "price"
Expected behavior
The value saved to the price field for the entry should be displayed.
Actual behavior
Stack Trace
Craft CMS version
4.0.2
PHP version
8.1.5
The text was updated successfully, but these errors were encountered: