Jump to content
  • 0

Order error: Object could not be converted to string


Question

Posted

Hi,

I Develops a new module. The module allows you to create new products. 
When I make an order in client area and click "Checkout & Pay" I get an error: 
"Uncaught Error, code 0 in ../vendors/minphp/language/src/Language.php on line 124 Message: Object of class stdClass could not be converted to string"

I add test empty product with "None" module and no errors appeared (item_string.png).
When dump the orders
I noticed that objects are being passed in "Item Ordered" (item_object.png).
Do you have any idea how to resolve this issue ?

 

 

 

item_string.png

item_object.png

2 answers to this question

Recommended Posts

  • 0
Posted

There is likely an erroneous call to Language::_() in your module.  Argument 1 take a language key (e.g. 'AdminClients.add.name'), Argument 2 is boolean true to return the language and store it in a variable or false to output it to the webpage, argument 3+ are values submitted to sprintf (e.g. language is 'My name is %1$s' and the call is Language::_('AdminMain.myinfo.myname', true, $name)).  Likely you've accidentally submitted an object in argument 3+

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...